MySQL SET random value?
#2

Quote:
Originally Posted by rOps
Посмотреть сообщение
Hi all. As you see, I want to set for one of the my MySQL tables random value, but I need to set not random (ex. 0, 1, 3, 4). I want to get 1 random value from 4 different values (ex. 2, 11, 5, 9).

Код HTML:
UPDATE `table_name` SET `some_thing` = 'FLOOR(1 + RAND() * 3)' WHERE `thing_some` = '1'
This is bad example, I don't need this, but I need something like this.
i don't think it's possible without using pawno or C++ / C#

this is proof : http://www.w3resource.com/mysql/math...d-function.php
Reply


Messages In This Thread
MySQL SET random value? - by rOps - 13.12.2016, 19:38
Re: MySQL SET random value? - by Yaa - 13.12.2016, 19:43
Re: MySQL SET random value? - by Konstantinos - 13.12.2016, 19:57
Re: MySQL SET random value? - by Yaa - 13.12.2016, 20:06

Forum Jump:


Users browsing this thread: 1 Guest(s)