连接查询,A连B,B筛选出多条记录时,选用第一条记录

            select msd.*,sc.*    FROM   MachinesShiftDetails as msd
                                OUTER APPLY (select top 1 * from ShiftCalendars where MachineShiftDetailId = msd.Id) as sc  

 

posted @ 2020-10-15 16:50  も不秃不秃  阅读(213)  评论(0编辑  收藏  举报