Help with a query - Mailing list pgsql-general

From jose antonio leo
Subject Help with a query
Date
Msg-id KAEFLIDKHEJNPPKOLGHMCELMDCAA.jaleo8@storelandia.com
Whole thread Raw
In response to Re: Returning with a userd defined type (PL/pgSQL)  (Joe Conway <mail@joeconway.com>)
Responses Re: Help with a query  (Richard Huxton <dev@archonet.com>)
List pgsql-general
Hi guys!

I need make a join query.
I have two tables with the next fields:

aec_cua_man:
ac1-ac2-ac3
1-1-1
1-1-2
1-1-4
1-2-2
....

aecoc:
ac1-ac2-ac3-description
1-0-0-des1
1-1-0-des2
1-1-1-des3
1-1-2-des4
1-1-3-des5
1-1-4-des6
1-1-5-des7
1-2-0-des8
1-2-1-des9
1-2-2-des10
....

I need the record of the first table with the fields ac1, ac2 and ac3 equals
than second table but in addition the fiels of the second table with a nul
in the fiels ac2 and ac3.

the table result will be:
1-0-0-des1
1-1-0-des2
1-1-1-des3
1-1-2-des4
1-1-4-des6
1-2-0-des8
1-2-2-des10

Could you help me?


Jose Antonio


pgsql-general by date:

Previous
From: mixo
Date:
Subject: transactions -- avoid hanging due to locks
Next
From: Együd Csaba
Date:
Subject: Re: Returning with a userd defined type (PL/pgSQL)