I have below query as
WITH search_agg as(
SELECT user_id, count(search_id) as count_search
WHERE date>current_date -interval '7 days'
GROUP BY user_id
SELECT count (distinct user_id)
If am correct, I don't need distinct in my outer query since my group by takes care of that correct? or is it better practice to have distinct anyway? Thanks