感觉自己好笨啊。。。
学习是最好的投资!
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
不要气馁
多熟悉下SQL就行了,和thinkPHP无关
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