concat与concat_ws区别

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/shujuelin/article/details/84333834

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 表

查询出结果为:大_小

猜你喜欢

转载自blog.csdn.net/shujuelin/article/details/84333834