I am trying to work out how to perform an SQL UPDATE table column from Table A into Table B. The problem I have is trying to concat multiple values from Table A Column X into Table B Column Y
TableA Structure id | Interest 1 | Bowling 2 | Swimming 1 | Basketball
TableB Structure id | Interest_new 1 | null 2 | null
I want Table B to have following data
TableB id | Interest_new 1 | Bowling,Basketball 2 | Swimming
This is my attempt with SQL query but it doesn't concat , just updated table B with first match
UPDATE TableB
INNER JOIN TableA ON TableB.id= TableA.id
SET TableB.id=CONCAT(TableA.id, ',')
where TableA.id= TableB.id;