今天有网友群里提了这样一个关于SQL联合查询的需求:
一、有热心网友的方案:
二、我的方案:
select * from (
select a.*,(select top 1 Id from B as b where b.CgId =a.ID)as bid
from A as a
) as temp left join B as b2 on temp.bid=b2.Id
时间: 2024-10-29 19:12:05
今天有网友群里提了这样一个关于SQL联合查询的需求:
一、有热心网友的方案:
二、我的方案:
select * from (
select a.*,(select top 1 Id from B as b where b.CgId =a.ID)as bid
from A as a
) as temp left join B as b2 on temp.bid=b2.Id