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)
 formin g sql query for navigation

Author  Topic 

svibuk
Yak Posting Veteran

62 Posts

Posted - 2012-02-22 : 06:20:19
select * , ,ROW_NUMBER() OVER
(ORDER BY NAME ASC) AS ROWID
from (select top 10 * ,ROW_NUMBER() OVER
(ORDER BY NAME ASC) AS ROWID from (select top (30)
* ,ROW_NUMBER() OVER
(ORDER BY NAME ASC) AS ROWID from EMPLOYEE order by NAME )
as T1 order by T1.NAME DESC) as T2 ORDER BY NAME ASC



currebtly i have above query
but i need the query

SELECT * ,ROW_NUMBER() OVER (ORDER BY NAME ASC)
AS ROWID FROM (SELECT * ,ROW_NUMBER() OVER (ORDER BY NAME ASC)
AS ROWID
FROM Employee e
) as DerivedTableName
WHERE rowid BETWEEN 1 AND 30

i need to naviaget between the next & previous buttons

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-02-22 : 07:50:32
I must admit - I didn't quite understand what you are asking. Are you trying to do paging? If you are, take a look at this article: http://www.sqlteam.com/article/server-side-paging-using-sql-server-2005
Go to Top of Page
   

- Advertisement -