select cyrdw as s,(select count(*) from caiyong where cylx = 'dantiao' and cyrdw = s),(select count(*) from caiyong where cylx = 'zonghe' and cyrdw = s),(select count(*) from caiyong where cylx = 'shendu' and cyrdw = s) from caiyong where time > '' and time < '' group by cyrdw order by desc
转载于:https://www.cnblogs.com/loveMis/p/9253525.html
本文提供了一个复杂的SQL查询案例,展示了如何从不同的角度(如单条、综合和深度)统计采用特定单位的数据量,通过group by和order by子句对结果进行分组和排序。

被折叠的 条评论
为什么被折叠?



