ػѹѺ ­ҧ ʾ. ࢵ 34 (§,ͧ͹) [ ʾ.§ 6]
ç¹ ͧ ͧ ͧ Թ ͧᴧ
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=14 AND im_school.area_type_id=2 AND im_school.zone_num=6 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 ͧ 51 36 17 104 92 13 2 2 107
2 49 30 9 88 79 11 0 0 90
3 ҪЪҹ 31 34 22 21 77 64 15 6 5 85
4 ҹ˹ 4 5 2 11 12 4 0 3 16
5 ૹ૿ 3 4 3 10 9 5 2 2 16
6 Ѵѹ˹ͧԷ 2 1 5 8 3 5 4 6 12
7 ҹҧ 2 1 1 4 3 4 1 0 8
8 ѸҳѲ 0 2 2 4 3 3 0 3 6
9 طԵԷ 0 0 2 2 1 2 4 3 7
145 101 62 308 266 62 19 24 347