Below is my query which will diplay the results.
select E.Colname
,max( case when CRF.RCD = '02' then CRF.RCD else null end)'Sm02'
,max( case when CRF.RCD = '03' then CRF.RCD else null end)'S03'
,max( case when CRF.RCD = '01' then CRF.RCD else null end)'I01'
,max( case when CRF.RCD = '04' then CRF.RCD else null end)'N04'
from tablename
Results:
Sm02 S03 I01 N04
----- ---- --- ----
02 NULL NULL 04
NULL NULL 01 NULL
02 NULL NULL NULL
02 NULL NULL NULL
02 03 01 NULL
I want the results: (when there is no values instead of null it should display empty)
Sm02 S03 I01 N04
----- ---- --- ----
02 04
01
02
02
02 03 01
select E.Colname
,max( case when CRF.RCD = '02' then CRF.RCD else null end)'Sm02'
,max( case when CRF.RCD = '03' then CRF.RCD else null end)'S03'
,max( case when CRF.RCD = '01' then CRF.RCD else null end)'I01'
,max( case when CRF.RCD = '04' then CRF.RCD else null end)'N04'
from tablename
Results:
Sm02 S03 I01 N04
----- ---- --- ----
02 NULL NULL 04
NULL NULL 01 NULL
02 NULL NULL NULL
02 NULL NULL NULL
02 03 01 NULL
I want the results: (when there is no values instead of null it should display empty)
Sm02 S03 I01 N04
----- ---- --- ----
02 04
01
02
02
02 03 01