Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

ALTER TABLE CHANGE COLUMN

Focus mode
ALTER TABLE CHANGE COLUMN - Amazon Athena

Changes the name, type, order, or comment for a column in a table.

Synopsis

ALTER TABLE [db_name.]table_name CHANGE [COLUMN] col_old_name col_new_name column_type [COMMENT col_comment] [FIRST|AFTER column_name]

Examples

The following example changes the column name area to zip, makes the data type integer, and places the renamed column after the id column.

ALTER TABLE example_table CHANGE COLUMN area zip int AFTER id

The following example adds a comment to the zip column in the metadata for example_table. To see the comment, use the AWS CLI aws athena get-table-metadata command or visit the schema for the table in the AWS Glue console.

ALTER TABLE example_table CHANGE COLUMN zip zip int COMMENT 'USA zipcode'

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.