I just started to learn MySQL. How can I get max reg_count row data in the following data?
id title genreID countryID artistID albumID reg_count ------ ------ ------- --------- -------- ------- --------- 16 hh 2 1 9 35 12 17 jj 2 1 9 36 34 18 kk 2 1 9 36 45 19 ll 2 1 10 33 56 20 zz 2 1 10 34 99 21 xx 2 1 10 34 52
I want to get the row data in which id is 18 and 20. These row data have max reg_count value in each artistID field. So I want to get the following row.
id title genreID countryID artistID albumID reg_count ------ ------ ------- --------- -------- ------- --------- 18 kk 2 1 9 36 45 20 zz 2 1 10 34 99
I tried with "GROUP BY". But I got unwanted results. How to get this ?