一般可用于优化涉及查询统计某些业务总数时可与主表进行关联缩小范围,查询结果直接作为查询字段
select count(1) from ( select a,b,count(count(1)) from table group by a,b) 或
select count(count(1)) from table group by a,b
一般可用于优化涉及查询统计某些业务总数时可与主表进行关联缩小范围,查询结果直接作为查询字段
select count(1) from ( select a,b,count(count(1)) from table group by a,b) 或
select count(count(1)) from table group by a,b