Reputation: 4015
I am having some difficulty with the following SQL:
SELECT SUM(mycount)
FROM
(SELECT COUNT(DISTINCT `User`) AS mycount
FROM `DBname`
WHERE date(Created) >= '2016-07-01'
) as R ;
The goal is to sum the count of unique entries over the course of the month.
Upvotes: 0
Views: 17939
Reputation: 2278
SELECT SUM(mycount)
FROM (
SELECT COUNT(DISTINCT `User`) AS mycount
FROM DBname
WHERE date(Created) >= '2016-07-01'
GROUP BY date(Created)
) as R ;
Upvotes: 6