数据库取表的前n条记录
程序员文章站
2022-03-26 19:19:40
...
关于row_number() over()的用法
介绍取一表前n笔记录的各种数据库的写法...
1. oracle
Select * from table1 where rownum<=n
2. informix
Select first n * from table1
3. db2
Select * row_number() over(order by col1 desc) as rownum where rownum<=n
Db2
Select column from table fetch first n rows only
4. sql server
Select top n * from table1
5. sybase
Select top n * from table1
6. mysql:
Select * from table_name limit n
上一篇: Jailer 4.0和4.0.1发布,智能数据提取工具
下一篇: JDBC连接主流数据库