RE: JOIN to the same table multiple times

2001-06-09 Thread Bob Hall
Ok, I've answered my own question but now have another. How do I reference the sitename for the 3 sites? sitename returns the last sitename for all 3 I tried S1.sitename etc. but it doesn't work. Sir, in what way does it fail to work? $query = SELECT * FROM department LEFT JOIN sites S1 ON

RE: JOIN to the same table multiple times

2001-06-08 Thread Ross Goonan
Ok, I've answered my own question but now have another. How do I reference the sitename for the 3 sites? sitename returns the last sitename for all 3 I tried S1.sitename etc. but it doesn't work. $query = SELECT * FROM department LEFT JOIN sites S1 ON deptsite1=S1.sitekey LEFT JOIN sites S2 ON

RE: JOIN to the same table multiple times

2001-06-08 Thread Chris Bolt
You really shouldn't be using SELECT *. Try SELECT S1.sitename AS FirstSiteName, S2.sitename AS SecondSiteName, etc etc etc. Ok, I've answered my own question but now have another. How do I reference the sitename for the 3 sites? sitename returns the last sitename for all 3 I tried