ػѹѺ ­ҧ ʾ. ࢵ 37 (,ҹ) [ ʾ. 2]
ç¹ ͧ ͧ ͧ Թ ͧᴧ
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=40 AND im_school.area_type_id=2 AND im_school.zone_num=2 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 ٧蹪ٻ 48 31 23 102 99 12 3 3 114
2 ͧԷ 36 22 19 77 80 12 0 1 92
3 õػ 24 22 17 63 60 20 3 3 83
4 ѧԷ 18 13 11 42 46 12 4 3 62
5 12 15 2 29 26 4 0 2 30
6 ҹȻЪҹ 9 4 6 19 22 9 3 2 34
7 Է 6 6 7 19 27 8 2 3 37
8 ͧԷҤ 0 0 1 1 1 0 0 0 1
153 113 86 352 361 77 15 17 453