Question Join/Subselect

From: Alex <alex(at)meerkatsoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Question Join/Subselect
Date: 2003-08-28 03:28:47
Message-ID: 3F4D76EF.30705@meerkatsoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have some problems with creating a query that will replace values in
one table from another one.

Table 1:
userName : refCode1 : refCode2
------------------------------
alex : 12 : 24

Table 2:
refCode : ActualCode
---------------------
12 AAAAAA
24 BBBBBB

Result Desired
userName : refCode1 : refCode2
------------------------------
alex : AAAAAA : BBBBBB

I need to crete a view that returns me Table1 but replaces refCode1,
refCode2 with the ActualCode.

I did not have any success with Joins or Subselects so far.

Thanks for any advise

Alex

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2003-08-28 03:30:13 Re: Recent installed 7.3.4 startup doubt
Previous Message Tom Lane 2003-08-28 03:25:39 Re: plpgsql FOUND Variable