max()函数是从一个表的列里面找出含有最大值的那一列
用法:
SELECT b.id,max(num) from (SELECT
a.topic_id id,count(*) num
FROM
diz_reply AS a where a.parent_id<>'0' GROUP BY a.topic_id) b;
max()函数是从一个表的列里面找出含有最大值的那一列
用法:
SELECT b.id,max(num) from (SELECT
a.topic_id id,count(*) num
FROM
diz_reply AS a where a.parent_id<>'0' GROUP BY a.topic_id) b;