sql - Find max group value without using Max()/Greatest() function -
i've been trying hours keep getting null result. far have got following table running query
select count(posts) dbtable group user
user | posts _____________ | 3 b | 7 c | 2 d | 1 e | 1 how can display user maximum posts without using max()/greatest() or limit functions. original table ran above query on had list of posts along user submitted each post, grouped them up.
select * ( select user,count(posts) cnt dbtable group user ) t1 left join ( select user,count(posts) cnt dbtable group user ) t2 on (t1.user<>t2.user) , (t1.cnt<t2.cnt) t2.cnt null
Comments
Post a Comment