没有读懂你的意思。不知道你最终要什么呢。。。说清楚一些。举例说明。。还有把你的sql语句发出来。放在最上面。。
select
case when SUBSTR(g.diagnosis_code,1,3) IN ('C34') THEN '肺癌'
when SUBSTR(g.diagnosis_code,1,3) IN ('C16') THEN '胃癌'
when SUBSTR(g.diagnosis_code,1,3) IN ('C22') THEN '肝癌'
when SUBSTR(g.diagnosis_code,1,3) IN ('C18','C19','C20') THEN '结直肠癌'
when SUBSTR(g.diagnosis_code,1,3) IN ('C50') THEN '乳腺癌'
else '其它不要' end as diagnosis
from v_mr_diagnosis_neworder g
join t_dc_inhospital_info c on g.DC_IN_ID =c.dc_in_id
where 1=1
and g.diagnosis_group='3'
and g.neworder<>'1'
and rownum=1
union all
select
case when and SUBSTR(g.diagnosis_code,1,3) IN ('主诊断') THEN '肺癌'
else '其它不要' end as diagnosis
from v_mr_diagnosis_neworder g
join t_dc_inhospital_info c on g.DC_IN_ID =c.dc_in_id
where 1=1
and g.diagnosis_group='3'
and g.neworder='1'
and rownum=1