I am trying to add a new column to an existing Table in snowflake, how to specify where to add the column. I tried the below query,
ALTER TABLE MY_DB.MY_SCHEMA.MY_TABLE
ADD COLUMN MY_NEW_COLUMN NUMBER(38,0) AFTER MY_OLD_COLUMN1;
AFTER
keyword doesn't works with Snowflake. Any suggestions on this would be helpful.
Create a table that contains different types of data stored inside a VARIANT column, then use TYPEOF to determine the data types of each piece of data.
Snowflake uses a sequence to generate the values for an auto-incremented column. Sequences have limitations; see Sequence Semantics. The default value for both start and step/increment is 1 . AUTOINCREMENT and IDENTITY can be used only for columns with numeric data types.
Today Snowflake does not have the ability to specify the position of the added column. It is in the list of future improvements, but we don't have an ETA on this yet.
Of course there are various solutions that might help, e.g. views, but I agree we'd ideally add this ability.
Let us know if we can help with anything else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With