group_concat 函数默认“,”合并 select p.id as patent_id,p.application_no,p.name,p.inventer,group_concat(pi.`name`) as sys_inventer from ip_patent 用指定符号分割 select p.id as patent_id,p.application_no,p.name,p.inventer,group_concat(pi.`name` separator ';') as sys
[本文出自:https://www.jb51.net/article/150323.htm] 这篇文章主要介绍了如何使用MySQL一个表中的字段更新另一个表中字段,需要的朋友可以参考下 1,修改1列 ? 1 2 3 update student s, city c set s.city_name = c.name where s.city_code = c.code; 2,修改多个列 ? 1 2 3 update a, b set a.title=b.title, a.name=b.name w
MySQL多表查询合并结果和内连接查询 1.使用union和union all合并两个查询结果:select 字段名 from tablename1 union select 字段名 from tablename2: 注意这个操作必须保证两张表字段相同,字段数据类型也相同,再针对结果统一排序操作等.另外,使用union的时候会去除重复(相同)的记录?,而union all则不会. create table table_new select * from ( SELECT * FROM DB.