ClickHouse/tests/queries/0_stateless/03103_positional_arguments.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
689 B
MySQL
Raw Normal View History

-- https://github.com/ClickHouse/ClickHouse/issues/56466
2024-07-12 12:49:26 +00:00
SET enable_analyzer=1;
2024-04-12 12:53:07 +00:00
DROP TABLE IF EXISTS users;
CREATE TABLE users (uid Int16, name String, age Int16) ENGINE=Memory;
INSERT INTO users VALUES (1231, 'John', 33);
INSERT INTO users VALUES (6666, 'Ksenia', 48);
INSERT INTO users VALUES (8888, 'Alice', 50);
2024-04-12 12:53:07 +00:00
-- The query works when using a single SELECT *
SELECT *
FROM
(
SELECT
name,
age
FROM users
)
GROUP BY
1,
2024-04-12 12:53:07 +00:00
2
ORDER BY ALL;
-- It doesn't when the GROUP BY is nested deeper
SELECT *
FROM
(
SELECT *
FROM
(
SELECT
name,
age
FROM users
)
GROUP BY
1,
2
2024-04-12 12:53:07 +00:00
)
ORDER BY ALL;
DROP TABLE IF EXISTS users;