-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Not found column when 'WITH TIES' is used. #8665
Copy link
Copy link
Closed
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official release
Description
select number, intDiv(number,5) value from numbers(20) order by value limit 3 with ties
SELECT
number,
intDiv(number, 5) AS value
FROM numbers(20)
ORDER BY value ASC
LIMIT 3
WITH TIES
↙ Progress: 0.00 rows, 0.00 B (0.00 rows/s., 0.00 B/s.) Received exception from server (version 19.16.10):
Code: 10. DB::Exception: Received from localhost:9000. DB::Exception: Not found column intDiv(number, 5) in block. There are only columns: number, value.
0 rows in set. Elapsed: 0.005 sec.
workaround:
select * from (select number, intDiv(number,5) value from numbers(20)) order by value limit 3 with ties
SELECT *
FROM
(
SELECT
number,
intDiv(number, 5) AS value
FROM numbers(20)
)
ORDER BY value ASC
LIMIT 3
WITH TIES
┌─number─┬─value─┐
│ 0 │ 0 │
│ 1 │ 0 │
│ 2 │ 0 │
│ 3 │ 0 │
│ 4 │ 0 │
└────────┴───────┘
5 rows in set. Elapsed: 0.003 sec.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugConfirmed user-visible misbehaviour in official releaseConfirmed user-visible misbehaviour in official release