I have a table active_users and from that i want to select the rows where user_id has occurred more than 2 times and notified = 0 .Want single result only
SELECT * FROM active_users WHERE notified = 0 GROUP BY user_id HAVING COUNT(id) >2