---
title: "mysql concat函数  字符串连接"
author: "gowithbutton"
date: "2011-12-07T15:15:50Z"
tags: []
slug: "mysql-concat"
draft: false
lastmod: "2011-12-07T15:15:50Z"
id: 1295894
url: "https://gowithbutton.iteye.com/blog/1295894"
---

**<span style="color: #0000ff; font-size: medium;">1.concat?</span>**?

<span style="white-space: pre;">	</span>select concat("http://",host,":",port) from hostInfo

?

**<span style="color: #0000ff; font-size: medium;">2.concat_ws?</span>**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;

?

?

?

参见

?

[http://apps.hi.baidu.com/share/detail/21460200](http://apps.hi.baidu.com/share/detail/21460200)