I have two tables user_profile and tracked_search. The user_profile table has user details and tracked_search tracks sear
user_profile
tracked_search
You need to write without AND u.id = ts.user_id.
AND u.id = ts.user_id
SELECT ts.created , count( distinct ts.user_id) FROM tracked_search ts, user_profile u WHERE ts.created>=(CURDATE()-INTERVAL 1 MONTH) group by ts.created;