SQL SELECT TOP N equivalent in ORACLE and MySQL

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

 http://dotnet.org.za/thea/archive/2005/02/22/14715.aspx

posted on 2006-09-05 18:13  KADreams  阅读(439)  评论(0)    收藏  举报