Table rows

  • 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

  • use order by NEWID ( )

  • Try this:

    Select * From "Table" Order by NEWID()

  • Can the table itself be reordered so that when we do select * from table the order is in a random fashion

  • 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