Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 want reslut without first row

Author  Topic 

asifbhura
Posting Yak Master

165 Posts

Posted - 2010-12-18 : 06:40:21
Hello,

I want all records from table without first row

Regards,
ASIF

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-12-18 : 07:45:33
Simple:
Use row_number function and consider the records where row_number is greater than 1
Go to Top of Page

niyaz4872
Starting Member

41 Posts

Posted - 2010-12-19 : 05:25:31
USE AdventureWorks;
GO
WITH OrderedOrders AS
(SELECT SalesOrderID, OrderDate,
ROW_NUMBER() OVER (order by OrderDate)as RowNumber
FROM Sales.SalesOrderHeader )
SELECT *
FROM OrderedOrders
WHERE RowNumber between 50 and 60;
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-12-19 : 11:06:18
First by what criteria?

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -