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