1. oracle資料庫
select * from tablename where rownum <= n
2. infomix資料庫
select first n * from tablename
3. db2資料庫
select *
from (select * row_number() over() as rownum from tablename)
where rownum <= n
或者select column from tablename fetch first n rows only
4. sql server資料庫
select top n * from tablename
5. sybase資料庫
set ro
wcount n
goselect * from tablename
6. mysql資料庫
select * from tablename limit n
7. foxpro資料庫
select * top n from tablename order by column
********
access:
select top* from table1 where 1=1
db2:
select column from table where 1=1 fetch first 10 rows only
mysql:
select * from table1 where 1=1 limit 10
sql server:
讀取前10條:select top* from table1 where 1=1
讀取後10條:select top* from table1 order by id desc
在sqlserver裡面,如何讀取按照某個排序,第5到10這五個記錄
select top 6 * from table where id not in
oracle:
select * from table1 where rownum=10
link:
********************
link:
各種資料庫查詢前幾條資料
1.oracle資料庫 select from tablename where rownum n 2.infomix資料庫 select first n from tablename 3.db2資料庫 select from select row number over as rownum from...
常用資料庫 取前幾條資料 sql寫法
如在ms sqlserver 用此語句 select top 2 from test01 就會只顯示前2條記錄,mysql select from your table where limit 2 使用limit就可以了.oracle的語句 select from select rownum r f...
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...