I am trying to return all portfolios, even if they don not have any that have NEWBIZ (return 0 with portfolio). I tried IFNULL. Not sure how to go about it. Any advice?
select ifnull(count(*),0) ,d.portfolio from dbase d, portfolios pf where statusname='NEWBIZ'
group by pf.portfolio order by pf.placementdate;