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 2000 Forums
 Transact-SQL (2000)
 Getting specified indexed rows

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-11-03 : 08:07:09
Balu writes "Hai,
I am Balu. I want to retreive rows from database with specified index number. Example, If my query returns 100 rows. But i want query to get 30-40 rows from that 100 rows. Please help me to write this query. I am using MS-SQL Server

Thanks & Regds,
Balu"

nr
SQLTeam MVY

12543 Posts

Posted - 2005-11-03 : 08:17:12
select top 10 * from (select top 40 * from tbl order by fld ) a order by fld desc


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-04 : 01:27:54
Here are some pagination techniques

http://weblogs.sqlteam.com/jeffs/archive/2003/12/22/672.aspx
http://www.aspfaq.com/show.asp?id=2120


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -