Remove incorrect statement from docs

Column that is in the USING clause is not required to be present in the column
list of the left side of the join (but it must be present in the table definition).

This reverts commit f2533a9653.
This commit is contained in:
Alexey Zatelepin 2018-10-29 19:21:01 +03:00
parent 83ac918bab
commit 6efd0f6bf7

View File

@ -346,42 +346,6 @@ The table name can be specified instead of a subquery. This is equivalent to the
All columns that are not needed for the JOIN are deleted from the subquery. All columns that are not needed for the JOIN are deleted from the subquery.
Example:
``` sql
SELECT
endpoint,
metric,
value,
idcName
FROM datapoints
ALL INNER JOIN
(
SELECT
ips AS endpoint,
idcName
FROM cmdb
) USING (endpoint)
LIMIT 10
```
```
┌─endpoint─────┬─metric────────────┬───────value─┬─idcName─┐
│ 192.168.1.100 │ disk.total │ 50465866000 │ office │
│ 192.168.1.100 │ disk.total │ 494927870 │ office │
│ 192.168.1.100 │ disk.used.percent │ 48 │ office │
│ 192.168.1.100 │ disk.used.percent │ 50 │ office │
│ 192.168.1.100 │ disk.util │ 0 │ office │
│ 192.168.1.100 │ disk.util │ 0 │ office │
│ 192.168.1.100 │ disk.util │ 0 │ office │
│ 192.168.1.100 │ disk.util │ 0 │ office │
│ 192.168.1.100 │ load.15min │ 0.02 │ office │
│ 192.168.1.100 │ load.1min │ 0.11 │ office │
└──────────────┴───────────────────┴─────────────┴─────────┘
```
Notice the column in `USING`(endpoint) must be in former `SELECT` column list and subquery's.
There are several types of JOINs: There are several types of JOINs:
`INNER` or `LEFT` type:If INNER is specified, the result will contain only those rows that have a matching row in the right table. `INNER` or `LEFT` type:If INNER is specified, the result will contain only those rows that have a matching row in the right table.