impala mysql coalesce 里面子查询

mysql支持
select coalesce(
(select 1 from tableA where customer_id = '1234' limit 1),
(select 1 from tableB where customer_id = '5678' limit 1),
0
)
常用于看一个客户是否存在于A表或B表中。

但是impala并不支持这样的语法,也尝试了去掉括号仍然报错,错误本质应该还是impala不支持
形如:
select (select df_days from t_installments where inst_num = 1 and loan_id = a.loan_id) AS fpd
from t_installments a
【AnalysisException: Subqueries are not supported in the select list.
子查询不支持在select list中,子查询可以在in list中




留言

熱門文章