General information
Category:
Coding, syntax & commands
>Does anyone know how I can create an index that would allow me to set a random order?
The mathemticians will probably get all fussy over this, but you could index off of a little udf that excepts a value (a field from your table) and builds a random number off of that.
Otherwise, I wouldn't use an index for this, I'd create a field just for the sort, have a routine populate that field randomly (using rand() most likely), and SET ORDER to an index on that field whenever you want a new random view of your cursor.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only