SQL Count Distinct over Rolling Window on Timestamp – Mysql
I have this SQL query: SELECT COUNT(DISTINCT CustomerName) over( ORDER BY OrderTimestamp RANGE BETWEEN INTERVAL 2 hour PRECEDING AND CURRENT ROW ) AS count_per_time FROM Orders WHERE CustomerName IS NOT null AND CustomerName != '' but it doesn't work because…