MySQL DB Table1
+----------+--------+--------+------------------+------------+------------+------------------+
| finnished| do_max | daylie | daylie_random | daylie_min | daylie_max | daylie_lastreset
+----------+--------+--------+------------------+------------+------------+------------------+
| 551232 | NULL | 203 | | 1000 | 2000 | 2021-04-20
+----------+--------+--------+------------------+------------+------------+------------------+
| 32103 | NULL | 103 | | 2000 | 3000 | 2021-04-20
+----------+--------+--------+------------------+------------+------------+------------------+
| 12121 | NULL | 53 | | 4000 | 5000 | 2021-04-20
+----------+--------+--------+------------------+------------+------------+------------------+
| 41222 | NULL | 22 | | 5000 | 6000 | 2021-04-20
+----------+--------+--------+------------------+------------+------------+------------------+
I Used for the daylie reset:
UPDATE table1 SET daylie=0, daylie_lastreset='2021-03-20' WHERE daylie_lastreset!='2021-04-20';
I added now the daylie_random Column Heres the question:
How do I UPDATE daylie_random for each entry to a value between daylie_min and daylie_max?
I couldn't figure out how to use in this case Select FLOOR( RAND() * (max+ min) as RandomValue; within the table and get the max and min from the row itself and for each row separately