I was trying to calculate unique pageviews for todayinclojure.com with a subquery
select count(ip_count) as visits, day from ( select count(ip) as ip_count, created_at - (created_at % 86400) as day from stat where created_at >= ? group by ip order by day desc ) as stat group by day order by day desc
but used distinct instead
select count(distinct ip) as visits, created_at - (created_at % 86400) as day from stat where created_at >= ? group by day order by day desc
and it worked.
No code? Try no scale.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I was trying to calculate unique pageviews for todayinclojure.com with a subquery
but used distinct instead
and it worked.
No code? Try no scale.