This is my query which needs to get modified for reflecting the time filters:
SELECT DATE AS TIME,mbps
FROM overage
WHERE DATE >= (CASE WHEN (DAY(CURDATE()) = 1 OR DAY(CURDATE()) = 2 OR DAY(CURDATE()) = 3 OR DAY(CURDATE()) = 4) THEN CONCAT(YEAR(CURDATE()),'-', MONTH(CURDATE() - INTERVAL 1 MONTH),'-04') ELSE CONCAT(YEAR(CURDATE()),'-', MONTH(CURDATE()),'-04') END) AND DATE <= (CURDATE() - INTERVAL 1 DAY)
ORDER BY DATE
CodePudding user response:
- $__timeFilter(column) -> column BETWEEN FROM_UNIXTIME(1492750877) AND FROM_UNIXTIME(1492750877)
Use this:
SELECT
date as time,
mbps
FROM overage
WHERE $__timeFilter(date)
GROUP BY DATE(date);