Select a random row from table, but with odds?

Posted by Don on Stack Overflow See other posts from Stack Overflow or by Don
Published on 2010-03-30T21:00:35Z Indexed on 2010/03/30 21:03 UTC
Read the original article Hit count: 341

Filed under:
|
|

I have a table that describes a variety of objects in my system (ie. umbrella, boots, satchel, whatever). Each one of these objects needs to have a distinct prevalence or incidence. For example, the umbrella is rarer than the boots. Based on those factors, I need to randomly select a single object (including a blank or 'no object found') based on that incidence value.

Yikes. Make sense?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about php