ArtCode
ArtCode

Reputation: 1

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

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.

Upvotes: 0

Views: 149

Answers (1)

P.Salmon
P.Salmon

Reputation: 17640

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) 
;

Upvotes: 1

Related Questions