连接查询,A连B,B筛选出多条记录时,选用第一条记录
select msd.*,sc.* FROM MachinesShiftDetails as msd OUTER APPLY (select top 1 * from ShiftCalendars where MachineShiftDetailId = msd.Id) as sc
Newd
版权声明
作者:も不秃不秃
地址:https://www.cnblogs.com/Newd/p/13821497.html
© Newd 尊重知识产权,引用请注出处
广告位
(虚位以待,如有需要请私信)