mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 12:01:58 +00:00
Note added, syntax error fixed
This commit is contained in:
parent
ecfa92bceb
commit
52686198e3
@ -43,6 +43,9 @@ The rest of the conditions and the `LIMIT` sampling constraint are executed in C
|
|||||||
|
|
||||||
A table object with the same columns as the original MySQL table.
|
A table object with the same columns as the original MySQL table.
|
||||||
|
|
||||||
|
!!! info "Note"
|
||||||
|
In the `INSERT` query to distinguish table function `mysql(...)` from table name with column names list you must use keywords `FUNCTION` or `TABLE FUNCTION`. See examples below.
|
||||||
|
|
||||||
**Examples**
|
**Examples**
|
||||||
|
|
||||||
Table in MySQL:
|
Table in MySQL:
|
||||||
@ -78,8 +81,8 @@ SELECT * FROM mysql('localhost:3306', 'test', 'test', 'bayonet', '123');
|
|||||||
Replacing and inserting:
|
Replacing and inserting:
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
INSERT INTO mysql('localhost:3306', 'test', 'test', 'bayonet', '123', 1) ('int_id', 'float') VALUES (1, 3);
|
INSERT INTO FUNCTION mysql('localhost:3306', 'test', 'test', 'bayonet', '123', 1) ('int_id', 'float') VALUES (1, 3);
|
||||||
INSERT INTO mysql('localhost:3306', 'test', 'test', 'bayonet', '123', 0, 'UPDATE int_id = int_id + 1') ('int_id', 'float') VALUES (1, 4);
|
INSERT INTO TABLE FUNCTION mysql('localhost:3306', 'test', 'test', 'bayonet', '123', 0, 'UPDATE int_id = int_id + 1') ('int_id', 'float') VALUES (1, 4);
|
||||||
SELECT * FROM mysql('localhost:3306', 'test', 'test', 'bayonet', '123');
|
SELECT * FROM mysql('localhost:3306', 'test', 'test', 'bayonet', '123');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user