6

I want to add a column in an existing table but not at the end , in between other columns does snowflake allow this

something like this

ALTER TABLE MY_DB.MY_SCHEMA.MY_TABLE ADD COLUMN MY_NEW_COLUMN NUMBER(38,0) AFTER MY_OLD_COLUMN1;

1 Answer 1

6

You can't control the ordering when you add a new column. However you can create and maintain a VIEW that orders columns in whatever sequence makes sense, different from the underlying table.

(You can also create a new table using CREATE TABLE ... AS SELECT ... and reorder columns, and then rename the new table to the old table.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.