我想从bannerstatclick表中有这些列(idBannerStats:整数,时间:时间戳,idCampaignBanner:char(36))的表格bannerstatclick中提取总点击时间(如按周或按月)。我想将最大时间计算为当前日期,然后在 30 天日期之前计算,然后找到此日期范围之间的点击次数,它不会返回任何输出...
SELECT count(idCampaignBanner) AS TotalClicks
FROM newradium.BannerStatsClick
WHERE Time BETWEEN
(Select max(`Time`) FROM newradium.BannerStatsClick)
And
(select max(`Time`)- INTERVAL 30 DAY FROM newradium.BannerStatsClick);