Hi all,
I have an issue where I need to return data from three tables. Below is my current query
SELECT d.SeqNo, d.SeqHeader, d.SeqText, d.OrderID, h.UniqueID, h.Room, h.AuditBy, h.SeqID, h.Status, h.CompStamp, h.WaterHot, h.WaterCold, c.Comments
FROM Table1 d
LEFT OUTER JOIN Table2 h
ON d.SeqID = h.SeqID
AND h.UniqueID = 'NX1234'
LEFT OUTER JOIN Table3 c
ON h.UniqueID = c.UniqueID AND c.UniqueID = 'NX1234'
WHERE d.SeqActive = 1
AND h.Status = 1
ORDER BY d.OrderID
I need to return all the records from "Table1" and all the records from "Table2" where the "SeqID" in both tables are equal and return all the reords from "Table3" where the "UniqueID" in "Table2" and "Table3" are equal.
I have tried a number a ways but each time the returned records are duplicated.
Can anyone see how I should be doing this.
Many thanks in advance for your time.