jeudi 23 juin 2016

How to insert values to random generated rows

To insert something to my mysql table i have to use this sql command:

INSERT INTO `votes` (`voteId`, `vote`, `pageId`, `userId`) VALUES (NULL, '5', '1', '1');

Right now I have about 30000 pageId. Let's say I would like to add to every single pageId from 5 to 25 votes. Every vote will be 1 or 5. But there would be from 50% to 100% change for vote of 5.

Is it possible to do? I tried to first use text spinner to generate votes from 1 to 5 but it is not efficient to do with such a big about of data.

Aucun commentaire:

Enregistrer un commentaire