0

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.

Siva
  • 1,481
  • 1
  • 18
  • 29
  • You should review Multiple-table syntax: https://dev.mysql.com/doc/refman/8.0/en/update.html. At present your query is not accessing the table import – P.Salmon Jan 29 '19 at 14:46

1 Answers1

1

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) 
;
P.Salmon
  • 17,104
  • 2
  • 12
  • 19