mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-14 03:25:15 +00:00
a4f2ee0752
Co-authored-by: Anna <42538400+adevyatova@users.noreply.github.com> Co-authored-by: romanzhukov <romanzhukov@yandex-team.ru> Co-authored-by: Vladimir <vdimir@yandex-team.ru>
22 lines
569 B
Markdown
22 lines
569 B
Markdown
---
|
|
toc_title: ALL
|
|
---
|
|
|
|
# ALL Clause {#select-all}
|
|
|
|
If there are multiple matching rows in the table, then `ALL` returns all of them. `SELECT ALL` is identical to `SELECT` without `DISTINCT`. If both `ALL` and `DISTINCT` specified, exception will be thrown.
|
|
|
|
|
|
`ALL` can also be specified inside aggregate function with the same effect(noop), for instance:
|
|
|
|
```sql
|
|
SELECT sum(ALL number) FROM numbers(10);
|
|
```
|
|
equals to
|
|
|
|
```sql
|
|
SELECT sum(number) FROM numbers(10);
|
|
```
|
|
|
|
[Original article](https://clickhouse.tech/docs/en/sql-reference/statements/select/all) <!--hide-->
|