I have an mnesia table t that contains records with a single field x. How can I select a random value x from t?
To avoid the entire of process of mathematical pedantry: I don’t care about the details of the random number generation, I just want my result to generally not be the same every time.
Thanks,
-tjw
By using the
mnesia:all_keys/1(or dirty equivalent) function and therandommodule.Don’t forget to initialize your seed using
random:seed/3.