[color=#121E9C][size=4][font=Arial]Hi Rajani,
Try this.
select
coalesce(inv.status_indicator, 99) as color_code,
count(*) as project_cnt,
coalesce((
select v.name
from cmn_lookups_v v
where v.lookup_type = 'INVESTMENT_STATUS_INDICATOR'
and v.language_code = 'en'
and v.lookup_enum = inv.status_indicator
), 'NONE') as color
from
inv_investments inv
group by inv.status_indicator
order by 1
I used the standard COALESCE function instead of the ORACLE specific nvl function to make this applicable to both MSSQL and QORACLE databases.
Hope this helps.
Patrick
[font][size][color]