提交 3286ce1b 编写于 作者: A ana-uvarova

example1

上级 528dca0f
......@@ -124,19 +124,19 @@ ALTER TABLE visits MODIFY COLUMN browser Array(String)
## MODIFY REMOVE
Removes something from a column. For example, ______
Removes something from a column. For example, TTL-property.
Syntax:
```sql
ALTER TABLE table_name MODIFY column_name REMOVE removing_part
ALTER TABLE table_name MODIFY column_name REMOVE property
```
**Example**
Request
```sql
ALTER TABLE table_name MOFIY COLUMN column_name REMOVE removing_part
ALTER TABLE table_name MODIFY column_name REMOVE removing_property
```
Result
......@@ -148,6 +148,7 @@ Result
- [ALTER](../../sql-reference/statements/alter/#query_language_queries_alter).
- [MODIFY column](../../sql-reference/statements/alter/column/#alter_modify-column).
- [REMOVE TTL](ttl.md).
Changing the column type is the only complex action – it changes the contents of files with data. For large tables, this may take a long time.
......
......@@ -25,22 +25,32 @@ ALTER TABLE table_name MODIFY column_name REMOVE TTL
**Example**
<!--Попробовать:
посмотреть установленные TTL,
показать состояние таблицы до,
удалить TTL
и показать состояние после.-->
Requests and results:
Request
To start the background cleaning using TTL, make this:
```sql
ALTER TABLE r_no_prop_table MODIFY COLUMN some_column REMOVE TTL;
OPTIMIZE TABLE table_with_ttl FINAL;
SELECT * FROM table_with_ttl;
```
Result
As a result you see that the second line was deleted.
```text
2020-12-11 12:44:57 1 username1
```
```sql
ALTER TABLE table_with_ttl REMOVE TTL;
INSERT INTO table_with_ttl VALUES (now() - INTERVAL 4 MONTH, 2, 'username2');
OPTIMIZE TABLE table_with_ttl FINAL;
SELECT * FROM table_with_ttl;
```
And now we have nothing to delete.
```text
--2020-12-11 12:44:57 1 username1
--2020-08-11 12:44:57 2 username2
```
### See Also
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册