pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: juerg.rietmann@pup.ch
To: pgsql-sql@postgresql.org
Subject: how to do this join ?
Date: Fri, 6 Apr 2001 14:10:15 +0200
Message-ID: <OF9E707DA8.649AA3F3-ONC1256A26.00427E3C@pup.ch> (raw)

Hello there

I have another SQL question. Please see the example :

select *,
(select a_typ from auftrag where a_nr=z_a_nr) as typ,
(select a_t_definition_d from auftrags_typ where a_t_code=typ) as text
from zylinder

I have three tables that I need data from. I'd like to use the <as typ> to
temporary store the kind of auftrag and then use it to get the
definition (clear text) from another table.

The query returns that typ is not known .

How can I do it ?

Thanks ... jr
============================================
PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315
============================================




view thread (3+ messages)  latest in thread

Message-ID: <OF9E707DA8.649AA3F3-ONC1256A26.00427E3C@pup.ch>
Permalink:  ../OF9E707DA8.649AA3F3-ONC1256A26.00427E3C@pup.ch/
Also on:    postgresql.org/message-id/OF9E707DA8.649AA3F3-ONC1256A26.00427E3C@pup.ch

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: juerg.rietmann@pup.ch
  Subject: Re: how to do this join ?
  In-Reply-To: <OF9E707DA8.649AA3F3-ONC1256A26.00427E3C@pup.ch>
  References: <OF9E707DA8.649AA3F3-ONC1256A26.00427E3C@pup.ch>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox