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.
| Author |
Topic |
|
rajvijaymohan
Starting Member
2 Posts |
Posted - 2006-10-25 : 08:30:35
|
| Is there any sql statement available to select 5th record to 16th record from a table ? (no field name can be given as a search criteria) |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-10-25 : 08:36:36
|
| select top 5 * from (select top 16 * from mytable order by mycolumn) order by mycolumn desc.There are lot of answers given here for pagination.Peter LarssonHelsingborg, Sweden |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2006-10-25 : 09:09:34
|
| It should be pointed out explicitly that in the absence of an ordering scheme, there is no concept of first, last, 5th, 16th or otherwise in set theory. A set is naturally unordered. This is why Peso has ordered both his derived table and outer select statement. If you exclude the order by clause on either, you may not get expected or consistant results.Jay White |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-10-25 : 09:12:59
|
| Job interview question.CODO ERGO SUM |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-10-25 : 11:10:14
|
quote: Originally posted by Michael Valentine Jones Job interview question.CODO ERGO SUM
No doubtMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|