pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: ssylla <stefansylla@gmx.de>
To: pgsql-sql@postgresql.org
Subject: query two tables using same lookup table
Date: Sun, 22 Jul 2012 20:04:32 -0700 (PDT)
Message-ID: <1343012672084-5717583.post@n5.nabble.com> (raw)

Dear list, 

assuming I have two tables as follows 

t1: 
id_project|id_auth 
1|1 
2|2 

t2: 
id_project|id_auth 
1|2 
2|1 


and a lookup-table: 

t3 
id_auth|name_auth 
1|name1 
2|name2 

Now I want to query t1 an t2 using the 'name_auth' column of lookup-table
t3, so that I get the following output: 
id_project|name_auth_t1|name_auth_t2 
1|name1|name2 
2|name2|name1 

Any ideas? 

Thanks- 
Stefan



--
View this message in context: http://postgresql.1045698.n5.nabble.com/query-two-tables-using-same-lookup-table-tp5717583.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



view thread (2+ messages)  latest in thread

Message-ID: <1343012672084-5717583.post@n5.nabble.com>
Permalink:  ../1343012672084-5717583.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1343012672084-5717583.post@n5.nabble.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: stefansylla@gmx.de
  Subject: Re: query two tables using same lookup table
  In-Reply-To: <1343012672084-5717583.post@n5.nabble.com>

* 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