ػѹѺ ­ҧ ʾ. ࢵ 8 (Ҫ,ҭ) [ ʾ.ҭ 4]
ç¹ ͧ ͧ ͧ Թ ͧᴧ
SELECT im_school.school_id AS s_id,im_school.school_name AS s_name, COUNT(*) AS NUB , COUNT(IF(im_team.award='ͧ',award,NULL)) AS gold_medal, COUNT(IF(im_team.award='Թ',award,NULL)) AS silver_medal, COUNT(IF(im_team.award='ͧᴧ',award,NULL)) AS bronze_medal, COUNT(IF(im_team.award='',award,NULL)) AS join_medal, COUNT(IF(im_team.rank='',rank,NULL)) AS winner, COUNT(IF(im_team.rank='ͧѹѺ ',rank,NULL)) AS two_rank, COUNT(IF(im_team.rank='ͧѹѺ ',rank,NULL)) AS three_rank FROM im_school,im_team WHERE im_school.province_id=3 AND im_school.area_type_id=2 AND im_school.zone_num=4 AND im_team.confirm_status=1 AND im_school.school_id=im_team.school_id GROUP BY im_team.school_id ORDER BY winner DESC, two_rank DESC, three_rank DESC, gold_medal DESC, silver_medal DESC,bronze_medal DESC,join_medal DESC, NUB DESC, s_name ASC
1 Ъ 36 30 11 77 50 17 10 12 77
2 Ңѭɮا 34 24 8 66 49 16 7 6 72
3 ;Ѫɡ 32 19 19 70 40 21 13 10 74
4 ˹ͧջЪҹԵ 22 18 12 52 26 20 5 8 51
5 ˹ͧ;ԷҤ 12 12 12 36 19 10 8 16 37
6 ҹ˹ͧ 8 8 4 20 9 7 6 9 22
144 111 66 321 193 91 49 61 333