-
Proposition: Write a Sql statement: Take out the 31st to 40th records in table A (the automatically growing ID is used as the primary key. Note: the IDs may not be consecutive.)
In oracle database:
1. select * from A where rownum<=40 minus select * from A where rownum<=30
In sqlserver database:
1. select top 10 * from A where id not in (select top 30 id from A )
2. select top 10 * from A where id>(select max(id) from (select top 30 id A) as A)
In mysql database:
SELECT * FROM A LIMIT 30,40
This article comes from the CSDN blog. Please indicate the source when reprinting: http://blog.csdn.net/fszhaotianle/archive/2009/12/20/5044260.aspx