ClickHouse/tests/queries/0_stateless/03099_analyzer_multi_join.sql

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

28 lines
543 B
MySQL
Raw Normal View History

-- https://github.com/ClickHouse/ClickHouse/issues/56503
2024-07-12 12:49:26 +00:00
SET enable_analyzer = 1;
SELECT
tb1.owner_id AS owner_id,
type
FROM
(
SELECT number AS owner_id
FROM numbers(100)
) AS tb1
CROSS JOIN values('type varchar', 'type1', 'type2', 'type3') AS pt
LEFT JOIN
(
SELECT tb2.owner_id AS owner_id
FROM
(
SELECT number AS owner_id
FROM numbers(100)
GROUP BY owner_id
) AS tb2
) AS merged USING (owner_id)
WHERE tb1.owner_id = merged.owner_id
GROUP BY
tb1.owner_id,
type
FORMAT `Null`;