E
E
ebbk2021-07-12 19:32:57
MySQL
ebbk, 2021-07-12 19:32:57

How do you filter by dates in a database?

I'm doing this for the first time please tell me how to reproduce the search by dates
like this I want it to find me records that have years from 2015 to 2020 how should I do?

Go through the for loop and collect records as for me is not an option, can there be a request for this?

SELECT * FROM `items` WHERE `date` = '2015-01-01'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2021-07-12
@ebbk

yes there is a request for that. you can use comparison signs, you can master BETWEEN.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question