I have a table called user_stats_clicks
Where there is a column for username
and dsub
. What I did first is get the last records for the past 10 days from yesterday.
SELECT * FROM `user_stats_clicks`
WHERE (`dsub` < CURRENT_DATE( )
AND `dsub` >= CURRENT_DATE( ) - INTERVAL 10 DAY)
Now I want to count how much instance is there per username
I triend using this
SELECT * FROM `user_stats_clicks`
WHERE (`dsub` < CURRENT_DATE( )
AND `dsub` >= CURRENT_DATE( ) - INTERVAL 10 DAY)
GROUP BY `username`
However I'm stuck after that. How Can I count the occurrence for each username?