各種資料庫中,如何讀取前10條記錄

2021-04-19 21:12:40 字數 712 閱讀 8492

1. oracle

select * from table1 where rownum<=n

2. informix

select first n * from table1 where 1=1

3. 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

4. sql server

select top n * from table1 where 1=1

orset rowcount n select * from table1 where 1=1 set rowcount n1

5. sybase

set rowcount n select * from table1 where 1=1 set rowcount n1

6. mysql

select * from table1 where 1=1 limit n

7. foxpro

select * top n from table order by column

8. access

select top n * from table1 where 1=1

各種資料庫取前10行記錄

各種資料庫取前10行記錄 收藏 access select top 10 from table1 where 1 1 db2 select column from table where 1 1 fetchfirst 10 rows only 取第三行到第5行的記錄 select from sele...

各種資料庫查詢前幾條資料

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...

簡單連線讀取資料庫mysql 各種資料庫簡單連線

我也忘了是從 找到了,不過很全,注釋得很好。1.c 連線連線access 程式 using system.data using system.data.oledb string strconnection provider microsoft.jet.oledb.4.0 strconnection ...