- mySQL JOIN query for users with 0 assigned records
- SELECT `user.id`, `user.admin`, `user.active`, `user.name`, `user.email`, `user.last`,
- (SELECT COUNT(*) FROM voter WHERE `user.id` = voter.owner)
- FROM `user`
- WHERE user.cid = '$cid'
- ORDER BY `user.id` ASC
- if(count(v.owner) is NULL,'0',count( v.owner )) as assigned
- SUM(if(v.owner is NULL,0,1) as assigned