Is there any way to migrate multiple columns data of table to only one column of other?
I need to migrate the data of table 1
subject varchar(45)
body text
recipients json
reason_id int
status tinyint(1)
to data (as an object)
field in table 2
I've tried this
INSERT INTO notice_templates (data)
SELECT json_build_object
('subject' , subject
,'body' , body
,'status_id' , status_id
,'reason_id' , reason_id
,'recipients' , recipients
) AS data
FROM notification;
But I get this error
#1305 - FUNCTION route_test.json_build_object does not exist