查詢前幾條記錄sql在不同資料庫中的用法
1. oracle
select * from table1 whererownum<=n
2.informix
selectfirstn * from table1
3. db2
select * row_number() over(order by col1 desc) as rownum where rownum<=n
或者select column from tablefetchfirst n rows only
4. sql server
selecttopn * from table1
5. sybase
setrowcount n
goselect * from table1
6. mysql
select * from table1limit n
7. foxpro
select * top n from table order by column
8.postgres
select * from table limit n
查詢前幾條記錄SQL在不同資料庫中的用法
查詢前幾條記錄sql在不同資料庫中的用法 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 ...
sql在不同資料庫查詢前幾條資料
sql在不同資料庫查詢前幾條資料 1.oracle select from table1 where rownum n hql from table1 t order by t.createtime desc where rownum n 2.informix select first n from...
sql在不同資料庫查詢前幾條資料
sql在不同資料庫查詢前幾條資料 1.oracle select from table1 where rownum n hql from table1 t order by t.createtime desc where rownum n 2.informix select first n from...