vendredi 27 novembre 2020

Random rows from db with each having equal probability

I have a database where I have a table with 100 rows, and I want to select 5 rows at random from that table such that each row has an equal chance to be selected.

Edit:

Basically, those rows are Ads and I want each Ad to get equal screen time. That is why any algorithm that just selects 5 rows randomly but also makes sure that each row gets selected equally in a day.




Aucun commentaire:

Enregistrer un commentaire