Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 我想将一列内容添加到同一表中的另一列_Mysql_Sql - Fatal编程技术网

Mysql 我想将一列内容添加到同一表中的另一列

Mysql 我想将一列内容添加到同一表中的另一列,mysql,sql,Mysql,Sql,我想知道是否可以通过查询将第二列中的两列连接起来 例如: Reference | Description ref1 | Des1 ref2 | Des2 ref3 | Des3 结果: Reference | Description ref1 | Des1 ref1 ref2 | Des2 ref2 ref3 | Des3 ref3 函数concat\u ws()执行您想要的操作: select t.*, concat_

我想知道是否可以通过查询将第二列中的两列连接起来

例如:

Reference | Description
ref1      | Des1 
ref2      | Des2 
ref3      | Des3 
结果:

Reference | Description
ref1      | Des1 ref1 
ref2      | Des2 ref2 
ref3      | Des3 ref3 

函数
concat\u ws()
执行您想要的操作:

select t.*, concat_ws(' ', reference, description)
from t;
您可以将其合并到
更新
或计算列中