By JortK on November 28, 2009
Just came across this great article with 20 best practices when using MySQL: MySQL best practices. Be sure to check them, the following items are in the article: Optimize Your Queries For the Query Cache LIMIT 1 When Getting a Unique Row Get Suggestions with PROCEDURE ANALYSE() Prepared Statements Split the Big DELETE or INSERT [...]
Posted in MySQL | Tagged best practices, cache, database, db, MySQL, query, select, show
By JortK on June 26, 2009
On the web I see a lot of questions of developers who are wanting to know how they can retrieve only the first N records in their queries. The answer is simple, LIMIT For example, if you only want to select the top 5 names from a names tables, use the following query: SELECT `firstname`,`lastname` [...]
Posted in How to | Tagged database, db, limit, MySQL, query, rownum, top, trick