日期:2014-05-16 浏览次数:21141 次
select a.ID, a.CNAME, a.SCORE,count(*) as SNO from tblA a inner 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(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