如何将一个表中的两个字段内容合并
如何将一个表中的两个字段内容合并
一个表中的两个字段a,b ,字段类型 mediumtext
要实现下面的目的
A=A+B
用下面的语句都不行,报错
如何才能实现
update a+b as a from table
和
update 表1 set 字段1=CONCAT(表2.字段2, 表1.字段1);
update table
set a=concat(a,b)
alter table tablename
drop column b
-
SQL code
mysql> create table testtext(a text,b text); Query OK, 0 rows affected (0.12 sec) mysql> insert into testtext values('a','b'); Query OK, 1 row affected (0.00 sec) mysql> update testtext set a = concat(a,b); Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0