select a.ID, a.CNAME, a.SCORE,count(b.ID)+1 as SNO
from tblA a left join tblA b on a.SCORE<b.SCORE
group by a.ID, a.CNAME, a.SCORE
order by a.SCORE desc
select a.ID, a.CNAME, a.SCORE,count(*) as SNO
from tblA a inner join tblA b on (a.SCORE<b.SCORE or (a.SCORE=b.SCORE and a.ID<=b.ID))
group by a.ID, a.CNAME, a.SCORE
order by 4
一、
select id,CNAME,SCORE,DCOUNT('ID','tblA','SCORE>=' & SCORE) as SNO
from tblA
order by 4
二、
select id,CNAME,SCORE,DCOUNT('ID','tblA','SCORE>' & SCORE)+1 as SNO
from tblA
order by 4
三、
select id,CNAME,SCORE,DCOUNT('ID','tblA','SCORE>' & SCORE & ' OR (SCORE=' & SCORE & ' AND ID>=' & ID & ')' ) as SNO
from tblA
order by 4作者: cc.man 时间: 2010-3-9 16:04
学习中,这里真是高手如林啊