i want to select all the row except the Top One so can anybody help me on this Query.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
with cte as
(
select *, row_number() over (order by CustomerId) RowNumber
from Sales.Customer
)
select *
from cte
where RowNumber != 1
OR
select *
from
(
select *, row_number() over (order by CustomerId) RowNumber
from Sales.Customer
) tt
where RowNumber != 1
回答2:
SELECT * FROM table1
EXCEPT SELECT TOP 1 * FROM table1
回答3:
In SQL Server 2012, you can do this:
select * from TableName order by Id offset 1 rows