jeudi 7 janvier 2016

SQL missing 0 values

I have problem with one query:

SELECT first_name, last_name, count(scheduleevents.id) 
FROM workers
JOIN scheduleevents 
ON scheduleevents.worker_id = workers.id

This query result is: Workers who have some events ( more than 0) in scheduleevents table but i want workers with 0 events too. LEFT JOIN don`t work and IFNULL option so how i can resolve this problem?

Aucun commentaire:

Enregistrer un commentaire