时间:2021-07-01 10:21:17 帮助过:25人阅读
感觉自己好笨啊。。。
M($table)->field('field,count(field)')->group('field')->select()
不要气馁
多熟悉下SQL就行了,和thinkPHP无关
select field,count(field) from table
select field,count(field) as ct from (select field from field) as tb group by field order by field;不知对否,自行测试
select field, count(field) from table group by field;
SQL GROUP BY