Monday, June 29, 2009

Limiting number of rows in Database

// mysql
select col from tbl limit 20;

// Oracle
select col from tbl where rownum<=20;

// Microsoft SQL
select top 20 col from tbl;

No comments: