'Migrate data from multiple columns of table to only one column of oher

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

enter image description here

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

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source