Need Help! Trying to determine how can I return all rows and IF chargetypeid '19' exist ALSO display that value but no other chargetypes? Currently it's returning all '19' chargetypes and ALL '0' but if I put "= chargetypeid = '19' it only returns data that has that value in it.
case when b.chargeTypeId=19 then '19' else '0' END as chargeType
left join invoice.invoice_charges b on b.invoiceid=a.invoiceid
a.cycleid IN ('388','398')
a.revenuestream = '50'
order by accountnum, chargeType desc, cycleid;