mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-12 02:23:14 +00:00
14 lines
637 B
Markdown
14 lines
637 B
Markdown
|
---
|
||
|
toc_priority: 50
|
||
|
---
|
||
|
|
||
|
# RENAME Statement {#misc_operations-rename}
|
||
|
|
||
|
Renames one or more tables.
|
||
|
|
||
|
``` sql
|
||
|
RENAME TABLE [db11.]name11 TO [db12.]name12, [db21.]name21 TO [db22.]name22, ... [ON CLUSTER cluster]
|
||
|
```
|
||
|
|
||
|
Renaming tables is a light operation. If you indicated another database after `TO`, the table will be moved to this database. However, the directories with databases must reside in the same file system (otherwise, an error is returned). If you rename multiple tables in one query, this is a non-atomic operation, it may be partially executed, queries in other sessions may receive the error `Table ... doesn't exist ..`.
|