我想选择除顶部行外的所有行,有人可以帮我解决这个查询吗。
我想选择除顶部行外的所有行,有人可以帮我解决这个查询吗。
with cte as
(
select *, row_number() over (order by CustomerId) RowNumber
from Sales.Customer
)
select *
from cte
where RowNumber != 1
或者
select *
from
(
select *, row_number() over (order by CustomerId) RowNumber
from Sales.Customer
) tt
where RowNumber != 1
cte
内部添加 where loan_id=1170
。 - Alex Azaselect * from TableName order by Id offset 1 rows
SELECT * FROM table1
EXCEPT SELECT TOP 1 * FROM table1
id
属性,那么我们可以使用...SELECT t1.* FROM table t1 LEFT JOIN (
SELECT id
FROM table
LIMIT 1
) t2 ON t1.id = t2.id
WHERE t2.id IS NULL;