Select Top在不同資料庫中的使用用法

2021-08-30 11:52:12 字數 616 閱讀 8149

select top在不同資料庫中的使用用法:

1. oracle資料庫

select * from table1 where rownum<=n

2. infomix資料庫

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資料庫

set rowcount n

go select * from table1

6. mysql資料庫

select * from table1 limit n

7. foxpro資料庫

select * top n from table order by column

講解七種資料庫中select top的使用方法

在網上摘下來的

Select Top在不同資料庫中的使用

select top在不同資料庫中的使用用法 1.oracle資料庫 select from table1 where rownum n 2.infomix資料庫 select first n from table1 3.db2資料庫 select row number over order by ...

Select Top在不同資料庫中的用法

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

Select Top在不同資料庫中的用法

從itpub上看到的乙個好貼,也經常用到,不是所有的平台均以測試,你可以自己試試看。1.oracle select from table1 where rownum n 2.informix select first n from table1 3.db2 select row number ove...