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   

sqlfiddle demo


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -