Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql help

Status
Not open for further replies.

Bri123456

Programmer
Jan 3, 2002
30
CA
Hi everyone i have a table (say tableA) that has employee id in it which references an employee table(TableE). And in tableA i have 3 fields that also contain employee id's from tableE that are involved with this subject, what I need is to print out the names of all of the employees i.e

Main_fistN, Main_lastN, involved1_firtsN,involved1_lastN, involved2_firtsN,involved2_lastN,involved3_firtsN, involved3_lastN

any help would be greatly appreciated
 
Select Main,firstN, Main.lastN, involved1.firstN,involved1.lastN, involved2.firstN,involved2.lastN,involved3.firstN, involved3.lastN
from tableA, TableE Main, TableE involved1,
TableE involved2, TableE involved3
Where tableA.MainEmpID = main.EmpID
And TableA.EmpID1 = involved1.EmpID (+)
And TableA.EmpID2 = involved2.EmpID (+)
And TableA.EmpID3 = involved3.EmpID (+)


this assumes that MAIN has to exist, but that 1 2 and 3 are optional.

(there are better forums for this than in an ERP forum) I tried to remain child-like, all I acheived was childish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top