June 19, 2008 at 11:00 am
Dear All,
I'm looking for a way to query the table's records absolutely in random in different times.
As you know when the records of a table retrieved by a query the result is ordered based on the value of a column as see the first column.
Would you please showing me how I can achieve to this problem.
Sincerely yours
June 19, 2008 at 11:08 am
Actually, the only way you can guarantee the order in which SQL Server will return the rows is to use the ORDER BY clause. All SELECT statements without an ORDER BY are not ordered, even if they appear to be. This sounds a bit homeworkish. Can you expand on what you are trying to accomplish by returning a randomly ordered result set? In fact, why don't you post some sample data and and example of how you want to see the results. Please include any attempts that you have made to do this.
June 19, 2008 at 11:26 am
John is right, we want to see some attempt.
As a hint, think NEWID()
June 19, 2008 at 12:00 pm
Some "hint" Steve - that looks suspiciously like an answer to me.
June 19, 2008 at 12:47 pm
If it wasn't then, it sure is now. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply