hive:concat与concat_ws区别

select concat('大','小') as size from 表

查询出结果为:大小

select concat('大',NULL) as size from 表

查询出结果为:null

concat中又一个参数为NULL,查出来的就为NULL

select concat_ws('_','大','小','中') as size from 表

查询出结果为:大_小_中

select concat_ws('_','大','小',NULL) as size from 表

查询出结果为:大_小

参考:https://www.cnblogs.com/Lcy-Sun0419/p/7843912.html

猜你喜欢

转载自blog.csdn.net/weixin_38750084/article/details/86027841