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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -