Webistrate - Draw Your Own Conclusions

MSSQL/MySQL: Delete Duplicate Rows in a Table

Posted by Jamie Munro | March 12, 2012 | Tags: ,

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!

See the solution »

Share


MSSQL/MySQL: Understanding how to Index your database

Posted by Jamie Munro | October 24, 2011 | Tags: ,

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.

See the solution »

Share


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

Posted by Jamie Munro | September 5, 2011 | Tags: ,

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.

See the solution »

Share


Buy one of my books