Home > Database > Mysql Tutorial > body text

mysql连接字符串,连接字段结果集_MySQL

WBOY
Release: 2016-06-01 13:52:20
Original
1108 people have browsed it

mysql连接字符串是CONCAT函数

select CONCAT('My', 'S', 'QL连接字符串') as MySql;


mysql连接字符串,连接字段结果集_MySQL

连接一个查询字段的结果集

select userName from emailaccounts where userID=31
Copy after login

查询结果

mysql连接字符串,连接字段结果集_MySQL

把这些结果集以","连接成一个字符串,group_concat('字段名'  separator ',')函数

 

    select group_concat(userName separator ',') as userName  from emailaccounts <br>    where userID=31
Copy after login

mysql连接字符串,连接字段结果集_MySQL

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!