Click here to monitor SSC

Caffeine Induced Tirades about .NET and Life

SQL – Joining to a Single Row

Published 23 March 2011 9:05 pm

If you have a one-to-many relationship, and you are performing a join on the tables but you only want one record from the “many” portion of the relationship, then this is a very helpful link:

http://stackoverflow.com/questions/2281551/tsql-left-join-and-only-last-row-from-right

The outer apply appears to be very useful for joining a single row in one table to a very specific single row in another table.  Not sure about efficiency, but it gets the job done.

Leave a Reply