一个表A里面有一个字符串字段gt,
gt里面的值为1,2,3,4,5
1,2,3,4,5等值为字典表中的id编号,
我想写一个函数,输入表A的id,gt返回值不是编号,而是字典表中的名词!!
------解决方案--------------------
- SQL code
select 名词 from 字典表 where id in( select regexp_substr(gt,'[^,]+',1,level) from A where A.id = 输入id connect by level <= length(gt)-length(replace(gt,',')) + 1 )