Thursday, May 31, 2012

MSSQL Random Rows

SELECT TOP 100 * FROM Company_Products p
ORDER BY (CAST(CHECKSUM(NEWID(),p.id) & 0x7fffffff AS float)
/ CAST (0x7fffffff AS int))

No comments:

Post a Comment