select t.cg_code,t.cg_name,t.zyly,d.dic_name as cg_type,d2.dic_name as trzj,d3.dic_name as xmly,d4.dic_name as cgsp, t.start_time,t.end_time,t.tzhsq,t.gbnf||'年' as gbnf,t.key_word,d5.dic_name as ps_org,d6.dic_name as ps_type, t.ps_date,t.main_org,t.main_people,t.link_name,t.link_tel,t.link_cz,t.link_email,t.link_adr,t.link_code,t.cg_des from KJTJ_CGGL t left join HDDB_JC_DICTIONARY d on t.cg_type = d.dic_type left join HDDB_JC_DICTIONARY d2 on t.trzj = d2.dic_type left join HDDB_JC_DICTIONARY d3 on t.xmly = d3.dic_type left join HDDB_JC_DICTIONARY d4 on t.cgsp = d4.dic_type left join HDDB_JC_DICTIONARY d5 on t.ps_org = d5.dic_type left join HDDB_JC_DICTIONARY d6 on t.ps_type = d6.dic_type
关联查询,将主表中多个字段中的值 与 字典表 进行映射替换。