ClickHouse/docs/en/sql-reference/statements/select/all.md

22 lines
568 B
Markdown
Raw Normal View History

2021-01-04 14:34:22 +00:00
---
2022-04-03 23:05:35 +00:00
toc_title: ALL
2021-01-04 14:34:22 +00:00
---
# 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.
2021-01-04 14:34:22 +00:00
`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.com/docs/en/sql-reference/statements/select/all) <!--hide-->