C
C
crack_user2020-12-10 15:27:52
PHP
crack_user, 2020-12-10 15:27:52

How to subtract or add random number to mysql column in php?

How to subtract or add a random number to a mysql column using php?
As an example, there is a column "a" with a value of 10, and how can I subtract a random number from these 10, specifically for column a.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FanatPHP, 2020-12-10
@FanatPHP

if you take away no more than there is, then
update t set a = a - FLOOR( 1 + RAND( ) * a );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question