现在的位置: 首页 > 综合 > 正文

SQL SELECT TOP N equivalent in ORACLE and MySQL

2013年12月20日 ⁄ 综合 ⁄ 共 302字 ⁄ 字号 评论关闭

SQL SELECT TOP N equivalent in ORACLE and MySQL

Something I needed today... I wish this was standarized, but it is not, so here are some examples:

SQL Server:

SELECT TOP 10 product, descr, email 
FROM products 

ORACLE:

SELECT product, descr, email
FROM products 
WHERE ROWNUM <= 10

MySQL:

SELECT product, descr, email
FROM products
LIMIT 10

抱歉!评论已关闭.