我需要修改我的查询以添加其他联接。但是新的联接可能需要是左联接。我不确定该怎么做。我正在使用 Informix:
set query "SELECT DISTINCT x.xfertype,x.app_type,x.service_type,x.lang,x.area_type,x.area_value,x.module,x.field1,x.field2,x.disabled,a.frames,a.allocs,a.term_id,t.term,c.center_id,c.center_name,a.message_id,x.field3,x.apn_type,x.global, a.icm, s.group_name "
append query " FROM test_xfertypes AS x, test_allocation AS a, test_terms AS t, test_callcenter AS c"
append query " AND a.xfertype = x.xfertype "
append query " AND a.term_id = t.term_id "
append query " AND t.center_id = c.center_id ";
test_xfertypes AS x
包含area_value
(整数)
我想用另一个新表加入上面的表test_routing_groups AS s
。
我想离开加入让它返回s.group_name WHERE x.area_value IN (s.area_id)
;如果 group_name 存在,则返回 group_name,否则返回 null。