首页 > 解决方案 > impala 的 SQL Case 语句

问题描述

我在 Impala 中有以下要求,有人可以帮我解决这个问题。

如果 table1.column1 为 null 或空字符串,则 table1.column2 else concat(table1.column1," ",table1.column2) 作为地址


select 
**the above condition** 
from table1.

标签: sql

解决方案


尝试这个

    Select case when  column1 is null or column1='' 
     then 
     column2 else concat(column1," ",column2) end as 
      address from table1

推荐阅读