Information générale
Catégorie:
Codage, syntaxe et commandes
>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.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement