{"id":176,"date":"2024-06-24T00:18:16","date_gmt":"2024-06-24T00:18:16","guid":{"rendered":"https:\/\/www.kwwd.co.uk\/blog\/?p=176"},"modified":"2024-06-24T00:18:16","modified_gmt":"2024-06-24T00:18:16","slug":"copy-mysql-table-structure-and-import-specific-columns","status":"publish","type":"post","link":"https:\/\/www.kwwd.co.uk\/blog\/copy-mysql-table-structure-and-import-specific-columns\/","title":{"rendered":"Copy MYSQL Table Structure and Import Specific Columns"},"content":{"rendered":"<p>This code will allow you to copy the table structure from an existing table into a new one and then copy data from specific columns<\/p>\n<pre><code class=\"language-sql\">-- Step 1: Create the new table with the same structure as the existing table\r\nCREATE TABLE NewTableName LIKE ExistingTableName;\r\n\r\n-- Step 2: Insert data from the specified columns of the existing table into the new table\r\nINSERT INTO NewTableName (Column1, Column2)\r\nSELECT Column1, Colum2\r\nFROM ExistingTableName;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This code will allow you to copy the table structure from an existing table into a new one and then copy data from specific columns [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[31,24],"class_list":["post-176","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-database","tag-mysql"],"_links":{"self":[{"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/posts\/176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=176"}],"version-history":[{"count":0,"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/posts\/176\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kwwd.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}