I my following query, the last column returns the count of the instances, for this instances with 0 count I would like to replace them with 'N/A'?
This query does not seems to work
select m.id, m.desc, count(IF(i.id is NULL,'N/A',i.id)) as quant
from menu m left join items i
on m.id = i.id
group by m.id
order by m.id;
The above query outputs as
============================
m.id |c.desc | qaunt
============================
1234 | Shoes | 1
1235 | Socks | 2
1236 | Clothes | 0
===========================
Expected result:
============================
m.id |m.desc | qaunt
============================
1234 | Shoes | 1
1235 | Socks | 2
1236 | Clothes | N/A
===========================
Could you please suggest me the changes in the above query