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 |
kadiyalabindu
Starting Member
7 Posts |
Posted - 2005-09-19 : 02:23:05
|
Hi All,I want an SQL query - select top 10 records except for the top 10 records.select top 10 records from tablename;Its not working.Can anyone solve this problem.Thanks in Advance |
|
Kristen
Test
22859 Posts |
Posted - 2005-09-19 : 02:27:50
|
"select top 10 records except for the top 10 records"Do you mean you want records 11-20 ?Kristen |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-19 : 02:29:36
|
>>select top 10 records from tablename;Its not working.Post some sample data and the result you wantMadhivananFailing to plan is Planning to fail |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-09-19 : 04:55:03
|
hmm... i think this is a paradoxdid you mean select next 10 records after the first 10 records like what Kristen asked?you need to post more information if you want your question answered quote: Originally posted by kadiyalabindu Hi All,I want an SQL query - select top 10 records except for the top 10 records.select top 10 records from tablename;Its not working.Can anyone solve this problem.Thanks in Advance
--------------------keeping it simple... |
|
|
supersql
Yak Posting Veteran
99 Posts |
Posted - 2005-09-19 : 09:23:29
|
BinduI understand that u need records from 11-20 as kristen said.Can u post ur query and the error u r getting. |
|
|
WYSIWYG
Starting Member
15 Posts |
Posted - 2005-09-19 : 16:40:36
|
Here is an example from the Northwind Database using the Orders table:-- first 10 ordersselect top 10 * from orders order by orderid-- next 10 ordersselect top 10 * from orders where orderid not in (select top 10 orderid from orders order by orderid)order by orderidNOTE: There may be a better solution, but this will exclude the top ten results. |
|
|
|
|
|