Join question - Mailing list pgsql-general

From Williams, Travis L, NPONS
Subject Join question
Date
Msg-id AB815D267EC31A4693CC24D234F8291604B6B163@ACCLUST02EVS1.ugd.att.com
Whole thread Raw
Responses Re: Join question  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: Join question  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
I have a table that is set up like this

table A:
First_name,Last_name,login

I have another table that is set up like this

table B:
date,date,person1,person2,person3

where the person1,2,3 is the login name from the first table.

I need to get the first_name and last_name of all 3 persons using one select (well I don't have to do it in one.. but I
thoughtit would be cleaner).. I can do one person using a join select like this: 

select A.First_name,A.Last_name from A,B where B.person1 = A.login

I tried adding an or statement like "or B.person2 = A.login" but that returns 2 entrys for each row.. where I'm trying
toget all the information back in one.   

Thanks in advance,

Travis



pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: How to deny user changing his own password?
Next
From: Mark Kirkwood
Date:
Subject: Re: change log 7.3.3