ClickHouse / ClickHouse/ClickHouse
UNKNOWN_IDENTIFIER with some valid query with weird aliases
- Dominant language
- C++
- Stars
- 49.9k
- Forks
- 9k
- Avg merge
- 21h 32m
- Merged PRs (30d)
- 515
Description
### Company or project name
”Federated Nations of Luna” (FNL)
### Describe the unexpected behaviour
It just a random query that I wrote to demonstrate how aliases are powerful unfortunately it does not work
### How to reproduce
```
CREATE TABLE users (uid Int16, name String, age DateTime) ENGINE=Memory;
INSERT INTO users VALUES (1231, 'John', 33);
INSERT INTO users VALUES (6666, 'Ksenia', 48);
INSERT INTO users VALUES (8888, 'Alice', 50);
from users
select
datetime_trunc_,
count() as event_count
group by (toStartOfDay(age) as datetime_trunc_) as xxxx
order by datetime_trunc_
DB::Exception: Unknown expression identifier `datetime_trunc_`
```
https://fiddle.clickhouse.com/0b3e6a79-567e-4e08-9bf5-0ef9d402e129
### Expected behavior
_No response_
### Error message and/or stacktrace
_No response_
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.