user123123123 user123123123 - 7 months ago 38
SQL Question

header row extraction and insertion in different tables using sql studio

I would like to extract the row header from a table and insert it in another table with the same number of columns and data type, how can i do it in sql studio without having to retype the whole headers again ?
header row

second table


You can use create table like

 CREATE TABLE new_tbl LIKE orig_tbl;

this create an empty table with the same column name of the orig_tbl

if you need to change the column name you can use alter table

ALTER TABLE your_table_name  CHANGE `Column 0`  `Extension Field 1` ;