how to do this join ?

From: juerg(dot)rietmann(at)pup(dot)ch
To: pgsql-sql(at)postgresql(dot)org
Subject: how to do this join ?
Date: 2001-04-06 12:10:15
Message-ID: OF9E707DA8.649AA3F3-ONC1256A26.00427E3C@pup.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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
============================================

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Hans-Jürgen Schönig 2001-04-06 12:24:34 Aliasing on tables ...
Previous Message Hans-Jürgen Schönig 2001-04-06 11:08:22 Casting numeric to text