Home >Unlabelled > Unexplored MySQL
Unexplored MySQL
Posted on Minggu, 15 April 2012 by Yana Xena
MySQL has a lot of usefull features that are not known by many programmers and DBAs. This article gives a short list of such features.
SQL_CALC_FOUND_ROWS
When it is necessary to extract data limited by certain number of records at one time and get total number of records meeting the condition, keep in mind the following elegant solution:
SELECT SQL_CALC_FOUND_ROWS * FROM `table` WHERE id > 100 LIMIT 10;
SELECT FOUND_ROWS();
First query return 10 records meeting the condition. Second
Diberdayakan oleh Blogger.