sql - impala 的 SQL Case 语句
问题描述
我在 Impala 中有以下要求,有人可以帮我解决这个问题。
如果 table1.column1 为 null 或空字符串,则 table1.column2 else concat(table1.column1," ",table1.column2) 作为地址
select
**the above condition**
from table1.
解决方案
尝试这个
Select case when column1 is null or column1=''
then
column2 else concat(column1," ",column2) end as
address from table1
推荐阅读
- mysql - MySQL 关系中的 Loopback 4 和约束
- django - Django 模板意外遗漏了 Elasticsearch 的结果
- react-native - 在 Redux 的操作中,使用回调调用函数(使用 async/await 和 React-Native-Contacts)
- wolfram-language - 绘制函数时显示的空白图
- python-3.x - 如何从 pythoncom 为 Windows 10 任务调度程序编辑任务设置
- javascript - 如何订购数组中的项目?
- javascript - JavaScript/jQuery 签名板
- environment-variables - Apache check if user is browsing their home directory
- hbase - Geomesa BBOX Query is not returning all results
- php - How to apply a session value to drop down list using blade in Laravel