Monday, July 6, 2009

SQL: How to fetch only 10 rows from different servers

Database SQL Syntax
DB2 ----> select * from table fetch first 10 rows only
Informix ---->select first 10 * from table
MS SQL Server and Access ----> select top 10 * from table
MySQL and PostgreSQL ----> select * from table limit 10
Oracle 8i ----> select * from (select * from table) where rownum <= 10

No comments:

Post a Comment