C
coolcat3000
Unregistered / Unconfirmed
GUEST, unregistred user!
select 参赛单位,tmp,(select count(参赛单位)
from (select 参赛单位,sum(最终得分) as tmp
from sporter
group by 参赛单位
order by sum(最终得分) desc) BBB
where tmp>AAA.tmp)+1
from
(select 参赛单位,sum(最终得分) as tmp
from sporter where 届数=:届数
group by 参赛单位
order by sum(最终得分) desc) AAA
from (select 参赛单位,sum(最终得分) as tmp
from sporter
group by 参赛单位
order by sum(最终得分) desc) BBB
where tmp>AAA.tmp)+1
from
(select 参赛单位,sum(最终得分) as tmp
from sporter where 届数=:届数
group by 参赛单位
order by sum(最终得分) desc) AAA