Heim > Datenbank > MySQL-Tutorial > MYSQL的group_concat()函数中实现将多行同一字段数据合并成一个_MySQL

MYSQL的group_concat()函数中实现将多行同一字段数据合并成一个_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Freigeben: 2016-06-01 13:40:57
Original
1380 Leute haben es durchsucht

bitsCN.com
MYSQL的group_concat()函数中实现将多行同一字段数据合并成一个数据 数据表 出访团组表 Sql代码  select a.t_applypersondocno,a.t_id from sx_fms_taskinfo a     结果集 
MYSQL的group_concat()函数中实现将多行同一字段数据合并成一个_MySQL 数据表  团组和国家关联表 Sql代码  select * from sx_fms_taskinfoid_countryid   结果集 
MYSQL的group_concat()函数中实现将多行同一字段数据合并成一个_MySQL 数据表  国家信息表 Sql代码  select c_id,c_name from sx_fms_countryinfo     结果集  MYSQL的group_concat()函数中实现将多行同一字段数据合并成一个_MySQL 进行关联后将出访国家组合到一起(组合前) 
 Sql代码  select taskinfo.t_applypersondocno, countryinfo.c_name from sx_fms_taskinfo taskinfo  left join sx_fms_taskinfoid_countryid tcinfo   on taskinfo.t_id = tcinfo.t_id   left join sx_fms_countryinfo countryinfo  on tcinfo.c_id = countryinfo.c_id    组合前  MYSQL的group_concat()函数中实现将多行同一字段数据合并成一个_MySQL 进行关联后将出访国家组合到一起(组合后) 使用了 group_concat(c_name) 
 Sql代码      select taskinfo.t_applypersondocno,group_concat(c_name) from sx_fms_taskinfo taskinfo  left join sx_fms_taskinfoid_countryid tcinfo   on taskinfo.t_id = tcinfo.t_id   left join sx_fms_countryinfo countryinfo  on tcinfo.c_id = countryinfo.c_id   group by taskinfo.t_applypersondocno    组合后 
MYSQL的group_concat()函数中实现将多行同一字段数据合并成一个_MySQL
  bitsCN.com

Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage