Ever needed to grab a selection of random rows from a table? Well, it's surprisingly easy in SQL Server 2000, using the NEWID()
method. The code below selects 10 random rows from "myTable".
SELECT TOP 10 id,title FROM myTable ORDER BY NEWID()
Great!
Comments