各种数据库sql语句取表中n-m条数据
2010-10-07 05:35
281 查看
命题:写出一条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
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
相关文章推荐
- T-SQL语句实现清空数据库数据的代码,保留原有表形式和各种约束
- T-SQL语句实现清空数据库数据的代码,保留原有表形式和各种约束
- 各种数据库sql语句取表中n-m条数据
- 数据库一张表的数据拷贝到另一张表中SQL语句
- 手动将excel表中的数据通过sql语句填入数据库
- C# 执行多条SQL语句,实现数据库事务(通过Hashtable存储数据) .
- Qt开发,链接了数据库后,调用QSqlQuery::setQuery执行SQL语句获取我们想要的数据
- 查找数据库指定数据的数据表和字段名称SQL语句
- 数据库中清空数据,保留表结构的sql语句
- sql语句获取日期大于当前日期的数据库数据
- 各种数据库分页查询sql语句大全
- NDatabase 入门,简单使用 增删改查。让NDatabase带你脱离ADO.net,各种SQL 语句,各种DBMS,各种CRM,IOC之类的烦恼。我们也不需要仓库设计模式了,你妹的。不要表了,不要设计数据库字段了。就这样!
- 使用SQL语句清空数据库所有表的数据
- Oracle 修改数据库库表的各种情况和SQL语句
- 我们曾经心碎的数据库之 用SQL语句操作数据
- 【ERP系统设计】【数据库设计】对数据表重命名和读取建表的SQL语句
- sql语句-删除数据库所有表里的数据
- mysql中获取一天、一周、一月时间数据的各种sql语句写法
- 使用SQL语句清空数据库所有表的数据
- s2sh向数据库插入数据,控制台有打印sql语句,数据库查询不到数据问题