simple select statement inquiry - Mailing list pgsql-sql

From Joseph Syjuco
Subject simple select statement inquiry
Date
Msg-id 3CFF78C6.82AEDF9A@asti.dost.gov.ph
Whole thread Raw
Responses Re: simple select statement inquiry  (Ludwig Lim <lud_nowhere_man@yahoo.com>)
List pgsql-sql
table1
empno varchar(9) not null
peer varchar(9) not null references table2(empno)
superior varchar(9) not null references table2(empno)

table2
empno varchar(9)
firstname varchar(20)
lastname varchar(20)

what i want to do is get all entries in table 1 and transform peer and
superior fields (which contains empno) into their respective firstname +
lastname in one query

desired output
empno             peer                   superior
1000        John Smith        Henry Dunst
2000        Juan dela Cruz        Pepe Smith

TIA
joseph


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Indexing Metaphone?
Next
From: Ludwig Lim
Date:
Subject: Re: simple select statement inquiry