How to concatenate 2 columns from another table to 1 table?

145 Views Asked by At

I'm setting up a new database and I need to concatenate 2 columns from another table to 1 column.

I've tried it with HeidiSQL. Is there a mistake in my code?

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

This is the error message:

"Unknown column 'importfile.Collection_Date'" in field list.

I am for 100% sure that the field list is actually there.

1

There are 1 best solutions below

0
P.Salmon On

You need to join import , your query should look more like this

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