-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOCSUP-4617: Document the union_default_mode setting #18153
DOCSUP-4617: Document the union_default_mode setting #18153
Conversation
Задокументировал настройку union_default_mode.
…-DOCSUP-4617-document_union_default_mode_setting
Изменил заголовок примера.
Убрал лишние символы.
Добавил подраздел в русскую версию, чтобы исправить битую ссылку.
Выполнил перевод на русский язык.
@akuzm Please, review this PR. |
@@ -2459,4 +2458,65 @@ Possible values: | |||
|
|||
Default value: `0`. | |||
|
|||
## union_default_mode {#union-default-mode} | |||
|
|||
Sets a special mode for combining `SELECT` query results using the [UNION](../../sql-reference/statements/select/union-all.md) expression. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing special with this mode.
@@ -2459,4 +2458,65 @@ Possible values: | |||
|
|||
Default value: `0`. | |||
|
|||
## union_default_mode {#union-default-mode} | |||
|
|||
Sets a special mode for combining `SELECT` query results using the [UNION](../../sql-reference/statements/select/union-all.md) expression. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be highlighted that it relates only to UNION without explicit UNION ALL or UNION DISTINCT specification.
Поддерживается только `UNION ALL`. Обычный `UNION` (`UNION DISTINCT`) не поддерживается. Если вам это нужно `UNION DISTINCT`, вы можете написать `SELECT DISTINCT` из подзапроса, содержащего `UNION ALL`. | ||
Разница между `UNION ALL` и `UNION DISTINCT` в том, что `UNION DISTINCT` выполняет явное преобразование для результата объединения. Это равнозначно выражению `SELECT DISTINCT` из подзапроса, содержащего `UNION ALL`. | ||
|
||
# Секция UNION {#union-clause} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Надо переписать - пусть будет всё про одну секцию UNION, которая специфицируется с помощью указания ALL или DISTINCT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
Объединил все в один раздел UNION.
Переструктурировал текст.
Подкорректировал английскую и русскую версии.
@alexey-milovidov Please, review this PR. |
…-DOCSUP-4617-document_union_default_mode_setting
|
||
Type casting is performed for unions. For example, if two queries being combined have the same field with non-`Nullable` and `Nullable` types from a compatible type, the resulting `UNION` has a `Nullable` type field. | ||
|
||
Queries that are parts of `UNION` can’t be enclosed in round brackets. [ORDER BY](../../../sql-reference/statements/select/order-by.md) and [LIMIT](../../../sql-reference/statements/select/limit.md) are applied to separate queries, not to the final result. If you need to apply a conversion to the final result, you can put all the queries with `UNION` in a subquery in the [FROM](../../../sql-reference/statements/select/from.md) clause. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now they can.
(SELECT 1 UNION SELECT 2) UNION (SELECT 3 UNION SELECT 2);
Изменил возможность записывать подзапросы с union в круглых скобках.
@alexey-milovidov Please, check this PR. I fixed it. |
Perftect. |
I decided to make a change in #18615 and has reflected it in the docs. |
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category:
union_default_mode
#16338