怎样找odd和even row# Database - 数据库
m*2
1 楼
用下面这个query,想找even rows
SELECT ID, [Date],ROW_NUMBER()OVER (ORDER BY [Date])
FROM [tbl] p
where (ROW_NUMBER()OVER (ORDER BY [Date]))%2 =0
但是出错:Windowed functions can only appear in the SELECT or ORDER BY
clauses
有啥别的方法吗?google了一圈,似乎没有啥有用的。
SQL server.
谢谢!
SELECT ID, [Date],ROW_NUMBER()OVER (ORDER BY [Date])
FROM [tbl] p
where (ROW_NUMBER()OVER (ORDER BY [Date]))%2 =0
但是出错:Windowed functions can only appear in the SELECT or ORDER BY
clauses
有啥别的方法吗?google了一圈,似乎没有啥有用的。
SQL server.
谢谢!