I need to provide the option to view the data according to a time X determined by the user, for example
I want the data from 03/01/2011 to 12/25/2014
How can I do this with MySQL? How do I set the table so everything can work out?
I need to provide the option to view the data according to a time X determined by the user, for example
I want the data from 03/01/2011 to 12/25/2014
How can I do this with MySQL? How do I set the table so everything can work out?
If you have a 'column' of type DATE , you can use the following:
SELECT * FROM table WHERE coluna > '2011-03-01' AND coluna < '2014-12-25'
If 'column' is in DATETIME you can use the following:
SELECT * FROM table WHERE coluna > '2011-03-01 00:00:00' AND coluna < '2014-12-25 00:00:00'
As your database was not specified, this could help. Of course, TIMESTAMP or TIME can be used, but only adapt.