各种不同数据库查询前几行/后几行的sql语句
SqlServer
select top 10 * from tablename;
Informix
select first 10 * from tablename;
Oralce
select * from tablename where rownum<=10;
MySql
select * from tableName limit 10
Db2
待续
本文介绍了在不同类型的数据库中如何使用SQL语句来查询表的前几条记录。覆盖了SqlServer、Informix、Oracle、MySql和Db2等主流数据库系统的具体实现方法。
各种不同数据库查询前几行/后几行的sql语句
SqlServer
select top 10 * from tablename;
Informix
select first 10 * from tablename;
Oralce
select * from tablename where rownum<=10;
MySql
select * from tableName limit 10
Db2
待续
1894