SQL Server交叉应用vs连接

时间:2016-05-15 09:16:36

标签: sql-server cross-apply

交叉申请和内部联接有什么区别?

特别是在选择前1名的情况下?

select 
    r.userId, acceptorId, pspCode, terminalId, zoneName, zoneCode     
from  
    reports..Report_950226 r        
cross apply
    (select top 1 
         acceptorId, branchCode, terminalId, pspCode
     from
         registerUser_AcceptorProfile ra
     where 
         ra.userId = r.userId 
     order by 
         id_ desc) acceptor 
inner join 
    registerUser_Branch branch on  branch.branchCode = acceptor.branchCode

0 个答案:

没有答案