[b]<span style="color: #0000ff; font-size: medium;">1.concat?</span>[/b]?
<span style="white-space: pre;"> </span>select concat("http://",host,":",port) from hostInfo
?
[b]<span style="color: #0000ff; font-size: medium;">2.concat_ws?</span>[/b]concat with seperator
<span style="white-space: pre;"> </span>select concat("|", f1,f2 ) from table
?
<span style="color: #ff0000; font-size: medium;">3.group_concat </span>? group by 的加强版
<span style="white-space: pre;"> </span>select age, group_concat(name) from student_info group by age;
?
?
?
参见
?
[url=http://apps.hi.baidu.com/share/detail/21460200]http://apps.hi.baidu.com/share/detail/21460200[/url]
<span style="white-space: pre;"> </span>select concat("http://",host,":",port) from hostInfo
?
[b]<span style="color: #0000ff; font-size: medium;">2.concat_ws?</span>[/b]concat with seperator
<span style="white-space: pre;"> </span>select concat("|", f1,f2 ) from table
?
<span style="color: #ff0000; font-size: medium;">3.group_concat </span>? group by 的加强版
<span style="white-space: pre;"> </span>select age, group_concat(name) from student_info group by age;
?
?
?
参见
?
[url=http://apps.hi.baidu.com/share/detail/21460200]http://apps.hi.baidu.com/share/detail/21460200[/url]

本文详细介绍了SQL中的concat、concat_ws和group_concat聚合函数的使用方法,包括具体语法和示例。
934

被折叠的 条评论
为什么被折叠?



