【赛迪网-it技术报道】在不同数据库环境下读取前n条记录数:
1. oracle
select * from table1 where rownum<=n
2. informix
select first n * from table1 where 1=1
3. mysql
select * from table1 where 1=1 limit n
4. db2
select * row_number() over(order by col1 desc) as rownum where rownum<=n
或者
select column from table where 1=1 fetch first n rows only
5.sql server
select top n * from table1 where 1=1
or
set rowcount n select * from table1 where 1=1 set rowcount n1
6. sybase
set rowcount n select * from table1 where 1=1 set rowcount n1
7. foxpro
select * top n from table order by column
8. access
select top n * from table1 where 1=1
闽公网安备 35060202000074号