SELECT
*
FROM
t_device_value_hour
WHERE
(
create_time >= date(now())
AND create_time < DATE_ADD(date(now()), INTERVAL 1 DAY)
)
AND time(create_time) BETWEEN time('8:00:00')
AND time('12:00:00')
ORDER BY
create_time
SELECT
*
FROM
t_device_value_minute
WHERE
TO_DAYS(create_time) = TO_DAYS(NOW())
AND time(create_time) BETWEEN time('14:00:00') AND time('18:00:00')
AND device_id = 7
AND channel = 1
AND node_type_id = 557
ORDER BY create_time