select
IMEI_ID, dev_status, nvl(count(1), 0) AS Count
from
device
where
IMEI_ID IN (284700, 250779, 320700, 339622, 323400)
and Dev_status = 'ACTIVE'
group by
IMEI_ID,dev_status;
For a few IMEI_ID
, no rows are returned. I want the count to be Zero (0) for these missing rows.
Thanks