Updated on 2025-10-14 GMT+08:00

RENAME TABLE

Function

RENAME TABLE renames a specified table.

RENAME TABLE has the same function as the following command:

1
ALTER TABLE table_name RENAME to new_table_name

Precautions

  • Tables cannot be renamed across schemas.
  • If no schema is specified for new_table_name, the new table (new_table_name) and the original table (table_name) are in the same schema.

Syntax

1
2
RENAME TABLE
{[schema.]table_name TO new_table_name} [, ...];

Parameter Description

Table 1 RENAME TABLE parameters

Parameter

Description

Value Range

schema

Specifies the schema name.

-

table_name

Specifies the name of the table to be modified.

-

new_table_name

Specifies the new table name.

-

Examples

Rename a table:

1
RENAME TABLE customer_address TO new_customer_address;