-
命题:写出一条Sql语句: 取出表A中第31到第40记录(自动增长的ID作为主键, 注意:ID可能不是连续的。)
oracle数据库中:
1、select * from A where rownum<=40 minus select * from A where rownum<=30
sqlserver数据库中:
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)
mysql数据库中:
SELECT * FROM A LIMIT 30,40
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/fszhaotianle/archive/2009/12/20/5044260.aspx