|
197、求出发帖最多的人:
select authorid,count(*) total from articles
group by authorid
having total=
(select max(total2) from (select count(*) total2 from articles group by authorid) as t);
select t.authorid,max(t.total) from
(select authorid,count(*) total from articles )as t
这条语句不行,因为max只有一列,不能与其他列混淆。
select authorid,count(*) total from articles
group by authorid having total=max(total)也不行。
|
来自安卓客户端
|