Skip to content
Advertisement

SQL Case statement for impala

I have below requirement in Impala, can someone please help me on this.

if table1.column1 is null or empty string ,then table1.column2 else concat(table1.column1,” “,table1.column2) as address

select 
**the above condition** 
from table1.

Advertisement

Answer

Try this

    Select case when  column1 is null or column1='' 
     then 
     column2 else concat(column1," ",column2) end as 
      address from table1
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement