mysql - SQL - find id / "x_id" of rowset with maximum number of rows -


having trouble (my)sql question...

i have data like:

id | x_id | bar 1  | 14a  | foo 2  | 15a  | baz 3  | 14a  | bim 4  | 15a  | bog 5  | 14a  | bit 

the result i'm looking 14a, chosen because there rows 14a x_id

select x_id, count(*) recordcount    tablename group    x_id order    count(*) desc limit 1 

Comments