oracle语句使用经验
SELECT --根据不同字典值去加‘前缀’方法一select CASEWHEN dict_code = 'YYPZ' THEN '0' || CODEELSE '1' || CODE end as code,name as namefrom MSTB_BDS_DATAwhere (dict_code = 'VOICEOTHERTYPE' or dict_code = 'YYPZ')and record_state = '1'方法二(select '0'||CODE code,NAME from MSTB_BDS_DATA d where d.dict_code='YYPZ' and record_state = '1' ) union all (select '1'||CODE code,NAME from MSTB_BDS_DATA d where d.dict_code='VOICEOTHERTYPE' and record_state = '1') (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |