powered by Slim Framework
enhanced by Nesbot.com

MSSQL/MySQL: Delete Duplicate Rows in a Table

Published on Mar 12, 2012 by Jamie Munro

No more must you think about how to find a clean way to delete duplicate records in your database table. The following article will provide a single SQL query that will delete rows that are duplicated in your table. Before you begin, be sure you've tracked down the bad code that is causing this; otherwise, you will need to run it multiple times!

Read more >

Tags: Database | MSSQL | MySQL

MSSQL/MySQL: Understanding how to Index your database

Published on Oct 24, 2011 by Jamie Munro

This is a must read for beginning developers in understanding how to index your database tables and more importantly, why you must index your database.

Read more >

Tags: Database | MSSQL | MySQL

MSSQL/MySQL: Improving ORDER BY RAND and ORDER BY NEWID

Published on Sep 5, 2011 by Jamie Munro

Whenever you need to display "random" data, it is always so tempting to take the simplest solution, e.g. SELECT * FROM mytable ORDER BY RAND(). This of course works perfectly; however, if your database table contains a lot of records (10,000+) a query like this can take seconds to complete instead of 1/10th of a second. With a bit of extra effort and careful thought, this process can be improved and still provide truly random results.

Read more >

Tags: Database | MSSQL | MySQL