/*MSSQL/MySQL: Improving ORDER BY RAND and ORDER BY NEWID*/?>
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.