日期:2014-05-17 浏览次数:20402 次
select * from (select *, row_number() over(order by id) RowNumber from SystemLog order by logData desc)t
--这语要怎么写.这样写报错
--要用ID做行号,获取行号又得以哪个字段来排序,
--实际需求要要按logData这个日期类型从最近时间来排序,这样写又报错,不解
--要加 TOP 100 PERCENT,SQL语法规定了
select * from (select TOP 100 PERCENT *, row_number() over(order by id) RowNumber from SystemLog order by logData desc)t
select * from
(select *,row_number() over(order by id) 'RowNumber'
from SystemLog) t
order by logData desc
select row_number() over(order by id) RowNumber,* from SystemLog
select row_number() over(order by id,logData desc) RowNumber,* from SystemLog