SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 Article: Using NEWID to Randomly Sort Records
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 04/16/2002 :  15:42:42  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
We've got a quite a few articles on randomly selecting and ordering rows. I'm still amazed how popular that topic is. I recently stumbled across a post in the forums that led me to a better way to accomplish this. This has actually been posted a few times before. I'm just finally catching up.

Article Link.

karlaane
Starting Member

Norway
1 Posts

Posted - 10/24/2002 :  11:58:19  Show Profile  Reply with Quote
Thanks for great tip, I have tried it, and;
Yes it does work in SQL 7

Karl Å. Rolfsvåg
Go to Top of Page

webq
Starting Member

1 Posts

Posted - 06/22/2007 :  18:22:12  Show Profile  Visit webq's Homepage  Reply with Quote
This is an old topic, but I was just revisiting it. I'm a bit of a statistician, and the data presented would not be enough to figure out how random the NEWID() function is. You would expect each number to be selected about the same frequency as all others, but if you were trying to figure out if it was random this way only, a non-random loop would appear to be random because you would end up with exactly the same frequency for each value.

You need some method of looking at the ordering of values. For example, how often a number is preceded by exactly the same the number.

www.webq.us
Go to Top of Page

binki
Starting Member

USA
1 Posts

Posted - 06/18/2014 :  14:32:53  Show Profile  Reply with Quote
What about the potential for completely non-random ordering as shown in http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=2242 ? Is NEWID() actually intended to be a source of randomness?

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000