tencent cloud

Feedback

ALTER TABLE ADD COLUMN AFTER/FIRST

Last updated: 2024-08-07 17:15:16

    Description

    Supported engines: Presto and SparkSQL
    Applicable table: Native Iceberg tables and external tables
    Purpose: Add column to data table.

    Standard Statement

    ALTER TABLE table_name ADD COLUMN column_name1 column_type [COMMENT col_comment] [FIRST|AFTER column_name2]

    Parameter

    table_name: Name of the target table
    column_name1: Column to be added
    column_type: Type of the column to be added
    col_comment: Comment for the column to be added
    column_name2: Column followed by the added column

    Example

    ALTER TABLE `TBL` ADD COLUMN `COL2` STRING COMMENT 'test' AFTER `COL1`
    
    ALTER TABLE `TBL` ADD COLUMN `COL2` STRING COMMENT 'test' FIRST
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support