Powered By Blogger

Thursday, 1 January 2009

how to LIMIT in Firebird, MySQL, and Interbase Databases

Usually if we want to view records, we can use query like this :

Select * from TBarang order by kodebr

here is query to view records with limitation using in MySQL, Firebird dan Interbase database

MySQL :

Select * From TBarang limit 5
Select * from TBarang limit 5,10

Firebird :

Select skip 5 * fromTBarang order by kodebr
Select first 10 * from TBarang order by kodebr
Select First 10 skip 5 * from TBarang order by kodebr


Interbase :

Select * from TBarang order by kodebr rows 1 to 5
Select * from TBarang order by kodebr rows 5 to 10

No comments: