07-02-2011

SQL limit returned rows in mysql, sqlserver and oracle

The following compares the syntax needed to limit the number of rows returned in each Mysql, MSsql and Oracle.

// mysql
select col from tbl limit 20;
 
// Oracle
select col from tbl where rownum<=20;
 
// Microsoft SQL
select top 20 col from tbl;

Comments:

Your comment:

»

 

[x]