sql在不同数据库查询前几条数据的方法

30秒到达战场
浏览 682回答 1
1回答

互换的青春

拿前10为例ORACLE:SELECT * FROM TABLE1 WHERE ROWNUM<=10&nbsp;2. INFORMIX:SELECT FIRST 10 * FROM TABLE1&nbsp;3. DB2 :SELECT * ROW_NUMBER() OVER(ORDER BY COL1 DESC) AS ROWNUM WHERE ROWNUM<=10&nbsp;4. SQL SERVER :SELECT TOP 10 * FROM TABLE1&nbsp;5. SYBASE :SET ROWCOUNT 10&nbsp;GO&nbsp;SELECT * FROM TABLE1&nbsp;6. mySql:SELECT * FROM TABLE1 LIMIT 10&nbsp;&nbsp;7. FOXPRO :SELECT * TOP 10 FROM TABLE ORDER BY COLUMN
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

SQL Server