级联查询sql

select '[' ||  t1.audit_type || ']' || t2.name  from audit_data_task_def t1  left join code_dict t2
on t2.catalog = 'T_AUDIT_METHOD' and t1.audit_type = t2.code;

select '[' ||  t1.audit_type || ']' || (select t.name from code_dict t where t.catalog = 'T_AUDIT_METHOD' and t.code = t1.audit_type)
from audit_data_task_def t1; 

你可能感兴趣的:(JOIN,sql)