user123123123 user123123123 - 3 months ago 5x
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` ;