There is data in the content2 table that you need to move to the content table

content2:

 id, title, category, directions, time, img, author, datetime 
  • If the content and content2 tables have the same structure, the listing of the content2 table fields is not necessary. If the structure is different, then it is necessary to specify the list of fields from the table content - ilyaplot

1 answer 1

 insert into content select * from content2 

Table structures must match. If you want to use a temporary table, you can do this:

 create table content as select * from content2; 

If the content table structure differs from content2, you can list the fields that need to be filled in and the fields from which data will be obtained.

  • You can also give an example, if the fields are different, in the content table the field title and content2 this field name - Kill Noise
  • If only the names of the fields differ, then everything should work. If the order of the fields is different, then you have to explicitly list them. If it doesn't work, you can do this: insert into content select id, title as name, category, directions, time, img, author, datetime from content2 - ilyaplot