не нравятся: SELECT name FROM <...> col.1 as _name<...>)?
SELECT _name as name, _price as price, avg
FROM (
SELECT arrayJoin(groupArray((name, price))) as col, col.1 as _name, col.2 as _price, avg(price) as avg
FROM (
SELECT arrayJoin([(3, 'a'), (5, 'b'), (3, 'c'), (3, 'd')]) as col, col.1 as price, col.2 as name
)
)
WHERE price > avg;
... ( WITH col.1 as price, col.2 as name SELECT arrayJoin([(3, 'a'), (5, 'b'), (3, 'c'), (3, 'd')]) as col, price, name ...
WITH надо писать на том же уровне, он вниз не пробрасывается
Обсуждают сегодня