I want to exclude the first row from displaying from a SQL Server 2005 Express database... how do I do this?
I know how to return just the top row, but how do I return all rows, except the top row
I want to exclude the first row from displaying from a SQL Server 2005 Express database... how do I do this?
I know how to return just the top row, but how do I return all rows, except the top row
SELECT *
FROM yourTable
WHERE id NOT IN (
SELECT TOP 1 id
FROM yourTable
ORDER BY yourOrderColumn)
SELECT *
FROM SomeTable
WHERE id <> (SELECT MIN(id) FROM SomeTable)
ORDER BY id
select * from
(select ROW_NUMBER() over (order by productid) as RowNum, * from products) as A
where A.RowNum > 1
When you say you don't want the top row I assume you have some kind of order by
that defines which row is at the top. This sample uses the ID
column to do that.
declare @T table(ID int, Col1 varchar(10))
insert into @T
select 1, 'Row 1' union all
select 2, 'Row 2' union all
select 3, 'Row 3'
select ID
from @T
where ID <> (select min(ID)
from @T)
order by ID