count number of entries including 0s sql
snippet in sql

count number of entries including 0s sql

user3401

-- If the table which contains the primary key is 
-- mentioned first in the QUERY then use LEFT join else RIGHT join.

select WARDNO, count(WARDCODE) from MAIPADH 
right join MSWARDH on MSWARDH.WARDNO = MAIPADH.WARDCODE
group by WARDNO