MySQL database, I have a table which contains some column. First column is datatime type, like "2016-03-01 08:00:00", "2016-03-02 08:00:00".
What should i do to get everyday's 8 AM. from this table?
MySQL database, I have a table which contains some column. First column is datatime type, like "2016-03-01 08:00:00", "2016-03-02 08:00:00".
What should i do to get everyday's 8 AM. from this table?
Assuming you want to return rows where the time is 8.00:
select ...
from a_table
where hour(some_column) = 8
and minute(some_column) = 0
http://www.w3resource.com/mysql/date-and-time-functions/mysql-hour-function.php http://www.techonthenet.com/mysql/functions/minute.php