v.20.6New Feature
Supported ALTER TABLE ... [ADD|MODIFY] COLUMN ... FIRST
Supported ALTER TABLE ... [ADD|MODIFY] COLUMN ... FIRST #4006. #12073 (Winter Zhang).Why it matters
This feature enables users to specify the position of a column when adding or modifying it in a table, specifically to place the column as the first column. This helps in organizing table schemas more flexibly and improving readability or compatibility with certain applications that expect columns in a particular order.How to use it
Use theALTER TABLE statement with ADD COLUMN or MODIFY COLUMN followed by the FIRST keyword to position the new or modified column as the first column in the table. Example:ALTER TABLE table_name ADD COLUMN new_column Type FIRST;
ALTER TABLE table_name MODIFY COLUMN existing_column NewType FIRST;