范围不要用OR ,用 in
用group分组后,除了统计每组的数量 count(*)以外,如何知道每组都有哪些数据?可以用group_concat(待显示的字段),例如:
select count(*),group_concat(id) as ‘序号’
from TT
group by status;
范围不要用OR ,用 in
用group分组后,除了统计每组的数量 count(*)以外,如何知道每组都有哪些数据?可以用group_concat(待显示的字段),例如:
select count(*),group_concat(id) as ‘序号’
from TT
group by status;