P
P
Pavel Chuev2016-02-21 22:28:28
PHP
Pavel Chuev, 2016-02-21 22:28:28

How to pull random value from MySQL by CURTIME()?

There is a mysql table with a bunch of values, where the time field contains the time in the format 23:59:59. How to pull out 1 random value if the value of time is two hours (or more) less than the present time. That is, now it is 22:27:49, how to pull out 1 random value from the table, in the fields of which the time is less than 20:27:49?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2016-02-21
@AllDecay

jan.kneschke.de/projects/mysql/order-by-rand
in where to use for example time < subtime(curtime(), '02:00:00')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question