w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Best way to limit JOIN to only select TOP 1

Using Cross Apply or Outer Apply

SELECT  * 
FROM    MOC_Links A
        OUTER APPLY
        (SELECT TOP 1 *
         FROM   MOC_Log AS D
         WHERE  D.itemID = A.itemID
         ORDER BY D.modTime DESC) D




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.