S
S
Sergey Leshchenko2018-05-02 17:24:05
SQL
Sergey Leshchenko, 2018-05-02 17:24:05

Selecting records from a db in a time span?

Screenshot of the database prntscr.com/jcsbqo
There is such a request, but it does not select the desired values.
SELECT `ip_adreess` FROM `requests` WHERE `date_create` >= DATE_SUB(CURTIME(),INTERVAL 1 HOUR);
I need to select `ip_adreess` between current time - 1 hour, how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2018-05-02
@Rsa97

CURTIME() returns only the time, no date. Use NOW().

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question