Friday, October 24, 2008

SQL SELECT TOP N equivalent in ORACLE and MySQL

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

1 comment:

Ned Polian said...

Hey, great blog, but I don’t understand how to add your site in my rss reader. Can you Help me please? product