The question is published on by Tutorial Guruji team.
I’m running a query to find users that have received services from our organization, but I don’t want their user id to be duplicated. For instance, I may have user id 1 in the system 5 times, but I only want their id to count as 1 occurrence. Here’s my query:
mysql_query("SELECT COUNT(*) AS 'total' FROM services LEFT JOIN users ON (services.USR_id = users.USR_id) LEFT JOIN service_type ON (services.SRV_type = service_type.TYPE_id) WHERE services.MGR_orgid = $mgrorgid GROUP BY services.USR_id");
group by ..., and change the