发布网友 发布时间:2022-04-24 09:01
我来回答
共1个回答
热心网友 时间:2022-06-18 07:45
select a.sno,a.sname,isnull(b.counts,0)from s a left join (select sno,sum(case when grade>80 then 1 else 0 end) counts from sc group by sno) bon a.sno=b.sno
sqlserver写法,其他数据库另外说明