SQL将指定表排序并输出满足条件的记录是第几条
Charles Chan @ 2011-12-27 #SQL @Program
Contents:
用于获取名次等的查询功能。
Select @result=fieldx from(
Select *, ROW_NUMBER() over (order by fieldy desc) as fieldx from table where xxx
) AS T
Where T.xx = xx
Charles Chan @ 2011-12-27 #SQL @Program
用于获取名次等的查询功能。
Select @result=fieldx from(
Select *, ROW_NUMBER() over (order by fieldy desc) as fieldx from table where xxx
) AS T
Where T.xx = xx