i have this table:
post{id, user_id, event_id}
i want to fetch all posts thats have an event_id(not NULL) for a particular user, and i dnt want an event_id to occur again, i want it to be distinct, i.e if 2 posts have an event_id of 2, then i only need one of them to be retrieved, thanks!!!
i.e.
select count(*)
from posts
where user_id = '43'
and
//not null event id
//distinct event id's
Try this to get the count of event id’s: