SELECT * FROM Table ORDER BY NEWID();To Select random rows from a Table UNION Table, then do:
SELECT TOP 10 PERCENT * FROM Table ORDER BY NEWID();
SELECT TOP 10 * FROM Table ORDER BY NEWID();
SELECT * FROM (SELECT TOP 10 Column1, Column2, Column 3 FROM Table1 ORDER BY NEWID()) TableA
UNION
SELECT * FROM (SELECT TOP 10 Column1, Column2, Column3 FROM Table2 ORDER BY NEWID()) TableB;
1 comment:
Awesome!
this is what i was looking for!
very simple and straight to the point!
Thanks
Post a Comment