mySQL count and get maximum from table -
i have simple question. have table structure http://sqlfiddle.com/#!2/61cee/3/0 , want count score of each player attacker , pick highest score players , id. tried this:
select max(counts), id_player (select count(score) counts, id_player fl_poll position = 'attacker' group id_player) maxi
but result wrong id. made mistake? advance.
select count(score) counts, id_player fl_poll position = 'attacker' group id_player order count(score) desc limit 1
Comments
Post a Comment