Last active
February 25, 2019 04:49
-
-
Save webmayak/f07f453d0c5101a930344116dc5b4e54 to your computer and use it in GitHub Desktop.
рандомизировать колонку даты в MySQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UPDATE `shop_product_reply` SET created = FROM_UNIXTIME(UNIX_TIMESTAMP('2018-09-10 14:53:27') + FLOOR(0 + (RAND() * 86400 * 30 * 5))) | |
| -- '2018-09-10 14:53:27' - дата старта рандомизации | |
| -- 30 - кол-во дней в месяце | |
| -- 5 - кол-во месяцев диапазона рандомизации |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment