当前位置: 代码迷 >> 综合 >> SQL SERVER – SELECTING TOP 1 IN A LEFT JOIN(SQL SERVER左连接与TOP 1同时使用)
  详细解决方案

SQL SERVER – SELECTING TOP 1 IN A LEFT JOIN(SQL SERVER左连接与TOP 1同时使用)

热度:84   发布时间:2024-01-13 15:45:38.0

引用地址https://himynameistim.wordpress.com/2014/04/07/sql-server-selecting-top-1-in-a-left-join/

SELECT c.*, la.* FROM Customer c OUTER APPLY (SELECT TOP 1 *FROM Address aWHERE a.CustomerID = c.CustomerIDORDER BY a.DateAdded DESC) AS la 
  相关解决方案