Home > database > [] SQL query problem how to query a week last month week live data
[] SQL query problem how to query a week last month week live data
Time:10-12
The table name: Test Column: dt, device_id
How to query data from 20200401 to 20200430 the inside every seven days?
CodePudding user response:
In a SQL run
CodePudding user response:
Is there any great god 0.0
CodePudding user response:
The SELECT aleem walji eeks, COUNT (1) num FROM (SELECT WEEK (DATE_ADD (dt, INTERVAL 6 DAY), 2) weekes, device_id FROM Test WHERE dt & gt;='2020-04-01' AND dt & lt;='2020-04-30'), a GROUP BY aleem walji eeks.