July 19, 2005 at 10:39 am
Hi
Once the rows are inserted in a database table is there a way to shuffle (reorder) the rows like a deck of cards so that if we select top 1 etc the results are at random.
Thanks
July 19, 2005 at 10:55 am
use order by NEWID ( )
July 19, 2005 at 10:56 am
Try this:
Select * From "Table" Order by NEWID()
July 19, 2005 at 11:29 am
Can the table itself be reordered so that when we do select * from table the order is in a random fashion
July 19, 2005 at 11:51 am
There is no order concept in an SQL Server Table.
You need to specify order by on your query to make sure the effects are repeatable!!!
* Noel
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply