Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Renaming columns and tables

Does the spanner supports renaming of columns and tables? That would be helpful while managing schema changes along with creating a new table from an existing one in a single statement.

like image 901
kanagaraj palanisamy Avatar asked Jun 02 '17 00:06

kanagaraj palanisamy


People also ask

How do I rename multiple columns?

To change multiple column names by name and by index use rename() function of the dplyr package and to rename by just name use setnames() from data. table . From R base functionality, we have colnames() and names() functions that can be used to rename a data frame column by a single index or name.

How do I rename a column in an existing table in SQL?

You select the table with ALTER TABLE table_name and then write which column to rename and what to rename it to with RENAME COLUMN old_name TO new_name .

How do you rename a table name?

ALTER TABLE table_name RENAME TO new_table_name; Columns can be also be given new name with the use of ALTER TABLE. QUERY: Change the name of column NAME to FIRST_NAME in table Student.


1 Answers

You cannot rename a column or a table. Other kinds of alterations are possible, but not renaming. A work-around for renaming columns is available in this answer: Is it possible to rename columns?

like image 122
Mike Curtiss Avatar answered Nov 26 '22 08:11

Mike Curtiss