[thelist] ASP.NET: UNION query not returning expected results

r937 rudy at r937.com
Thu Sep 27 15:57:41 CDT 2007


SELECT O.id               AS OfficeID
     , O.number           AS Office 
  FROM dbo.Employees as E
INNER
  JOIN dbo.Offices as O
    ON O.id = E.OfficeID
 WHERE E.id = 57 
UNION ALL
SELECT O.id  
     , O.number  
  FROM dbo.Offices as O
LEFT OUTER
  JOIN dbo.Employees as E
    ON E.OfficeID = O.id
 WHERE E.OfficeID IS NULL 


any questions, please just ask

;o)




More information about the thelist mailing list