SELECT dict_name FROM sys_dictionary WHERE dict_type = 'gateway' and dict_code = beg.gateway_type
这一条作为子查询时出现syntax error at end of input错误

百度一下是因为参数为空导致的, beg.gateway_type这个是左连接的右表, 所以的确可能为空.
于是我加了一个判断, 改为:
CASE WHEN gateway_type is not null THEN (SELECT dict_name FROM sys_dictionary WHERE dict_type = 'gateway' and dict_code = beg.gateway_type) ELSE null END as gateway_typename

就好了

posted on 2020-12-14 14:46  一贯可乐  阅读(13183)  评论(0编辑  收藏  举报



123