Skip to main content

RENAME TABLE

Changes the name of a table.

Syntax

ALTER TABLE [ IF EXISTS ] <name> RENAME TO <new_table_name>

Examples

CREATE TABLE test(a INT);
SHOW TABLES;
+------+
| name |
+------+
| test |
+------+
ALTER TABLE `test` RENAME TO `new_test`;
SHOW TABLES;
+----------+
| name |
+----------+
| new_test |
+----------+
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today