how to modify data type of a column explicitly via DBSQL

xwen
New Contributor II

xwen
New Contributor II

 

In place schema adjustment =>
Then ALTER TABLE XXX ADD/DROP COLUMN XXX INT
Example
create table test (id int, first_name string, last_name string ); insert into test values (1, 'john', 'smith'); alter table test add column age int; select * from test
Create a new table with an adjusted Schema =>
Then CTAS should do the trickCREATE OR REPLACE TABLE [new_table] AS ( SELECT * FROM OLD_TABLE ... )