概述
这三个字段,通过各个函数结果
concat_ws
用相应符号将各字段连接起来 string类型
select concat_ws(',',user_id,mobile,system) as concat
from statistic.qz_track
limit 5;
concat
"13742988,,android"
"38643821,+8613075351265,android"
"11230781,,android"
"38702379,,android"
"0,+8613414655611,android"
spilt
将上述结果通过spilt , 分开
select split(concat_ws(",",user_id,mobile,system), ",") con_sp
from statistic.qz_track
limit 5;
con_sp
"[""13742988"","""",""android""]"
"[""38643821"",""+8613075351265"",""android""]"
"[""11230781"","""",""android""]"
"[""38702379"","""",""android""]"
"[""0"",""+8613414655611"",""android""]"
sort_array 默认升序
select sort_array(split(concat_ws(",",user_id,mobile,system), ",")) as con_sa
from statistic.qz_track
limit 5;
con_sa
"["""",""13742988"",""android""]"
"[""+8613075351265"",""38643821"",""android""]"
"["""",""11230781"",""android""]"
"["""",""38702379"",""android""]"
"[""+8613414655611"",""0"",""android""]"
最后
以上就是开心唇彩为你收集整理的concat_ws, spilt, sort_array,size的全部内容,希望文章能够帮你解决concat_ws, spilt, sort_array,size所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复