Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

left join with only first record

SELECT t1.*, t2.*
FROM Table1 AS t1 LEFT JOIN (
    SELECT *, ROW_NUMBER() OVER(PARTITION BY FK_Table1 ORDER BY [Date] DESC) AS RowNo
    FROM Table2  
) AS t2 ON t1.ID = t2.FK_Table1 AND t2.RowNo = 1
Source by www.codeproject.com #
 
PREVIOUS NEXT
Tagged: #left #join #record
ADD COMMENT
Topic
Name
3+3 =