[quote=引用 2 楼 chz415767975 的回复:] 举个例子给你 select (select count(*) from tb) as [sum1],(select count(*) from tb2) as [sum2],(select count(*) from tb3) as [sum3]
select (select count(*) from tb) as [sum1],(select count(*) from tb2) as [sum2],(select count(*) from tb3) as [sum3]
举个例子给你 select (select count(*) from tb) as [sum1],(select count(*) from tb2) as [sum2],(select count(*) from tb3) as [sum3]
前三个查询要带出一个标识列,然后和第四个查询join起来
你这个应该可以用SUM(CASE WHEN ...)来解决。
22,207
社区成员
121,730
社区内容
加载中
试试用AI创作助手写篇文章吧