【问题标题】:How to concatenate 2 columns from another table to 1 table?如何将另一个表的 2 列连接到 1 个表?
【发布时间】:2019-06-22 17:21:14
【问题描述】:

我正在设置一个新数据库,我需要将另一个表中的concatenate 2 列添加到 1 列。

我已经用HeidiSQL 试过了。我的代码有错误吗?

UPDATE annotationfile
SET LABSDTM = CONCAT_WS('T',importfile.Collection_Date, importfile.Collection_Time)  ;

这是错误信息:

“未知列'importfile.Collection_Date'”在字段列表中。

我 100% 确定字段列表确实存在。

【问题讨论】:

标签: mysql concatenation multiple-columns concat-ws


【解决方案1】:

你需要加入 import ,你的查询应该看起来更像这样

UPDATE annotationfile join import on something 
SET LABSDTM = CONCAT_WS('T',importfile.Collection_Date, importfile.Collection_Time) 
;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-02
    • 1970-01-01
    • 2023-03-19
    • 1970-01-01
    • 2022-12-01
    • 1970-01-01
    相关资源
    最近更新 更多