个人备忘录
将多个字符串连接
数据中有null值时,连接结果为null
concat()函数
语法:concat(str1, str2,…)
select id_no,name_,sala_belo_city_code from st_staff
where sala_belo_city_code = '10000000'
查询出的身份证号码,导出csv时身份证号会出问题。
使用concat()函数
select concat('’',id_no),name_,sala_belo_city_code from st_staff
where sala_belo_city_code = '10000000'
连接时需要更多分隔符的,建议去看concat_ws()函数。
concat_ws()
语法:concat_ws(指定的分隔符, str1, str2, …)
例: concat_ws('@',str1, str2)