Lyle
Member since Feb 3, 2009
- Profile: /members/2882-lyle.htm
- Comments: 2
Recent Blog Comments By Lyle
-
Ask Ben: Selecting Random Values Without Repetition In ColdFusion
Posted on Feb 4, 2009 at 2:51 AM
Hi Brandon, Does that take care of duplicate selections? It seems like you would have a chance of grabbing the first element of the complete list with each loop iteration. With a List (MyList) and a desire of 4 randomized values (ToValue), you could alter the array code to: <cfset ListLength ... read more »
-
Ask Ben: Selecting Random Values Without Repetition In ColdFusion
Posted on Feb 3, 2009 at 5:49 PM
For this guy, it should be done on the database side. In SQL Server, you add ORDER BY NewID() This blog has a run down of a host of random ordering options in different databases: http://www.carlj.ca/2007/12/16/selecting-random-records-with-sql/ If you have an Array, MyArray, an efficient proces... read more »