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

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Live
  • Google Bookmarks
  • BlinkList
  • FriendFeed
  • Ping.fm
  • StumbleUpon
  • Technorati
  • Mixx
  • Reddit
  • Blogosphere News
  • Fark
  • Identi.ca
  • LinkedIn
  • Sphinn
  • TwitThis
  • E-mail this story to a friend!
  • Print this article!

Related posts:

  1. Multiple SQL inserts: Oracle, Mysql, Mssql I've found a useful technique for inserting multiple rows into...
  2. Eclipse Oracle Plugin jOra is an Eclipse-Plugin for Oracle Developers and Oracle Admins....