Not sure that the title best describes this.
I've got two tables which I'll simplify here
t1 - building (BuildingCode, Reception, Porter, Manager)
A, 1, 3, 8
B, 2, 4, 9
C, 1, 4, 7
t2 - staff (ID, Name, Extn)
1, Dave, 3302
2, Chris, 3994
3, Claire, 3033
8, Simon, 3255
and i'd like to get a table out that looks like
A, Dave, 3302, Claire, 3033, Simon, 3255
B, Chris, 3994 etc.
select b.buildingCode, s.Name, s.Extn
from building b, staff s
where s.ID = b.Reception
would give me one set of details - how can i get all 3?
Do I need to do 3 queries - where s.ID = b.Reception, where
s.ID = b.Porter and where s.ID = b.Manager and then join the 3
tables together or is there a more direct route?
Many thanks
Michael