When you perform a left join in TSQL (MSSQL SERVER) is there any guarantee which row will return with your query if there are multiple rows on the right?
I'm trying to use this to exploit an ordering on the right table.
so
Select ColA, ColB, ColC
from T
Left Outer Join
(Select ColA, ColB, ColC
from T--CLARIFIED, this is a self join.
Order by TopColumn Desc) AS OrderedT(ColA, ColB, ColC)
On T.ColA = OrderedT.ColA
I would expect to retrieve all the ColA's in Table, and all the first row in the set of ColA results for my left join based on my ordering.
Is there any guarantee made on this by the language or server?