mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 01:41:59 +00:00
25 lines
401 B
SQL
25 lines
401 B
SQL
-- Tags: no-parallel-replicas
|
|
|
|
SELECT
|
|
EventDate,
|
|
hits,
|
|
visits
|
|
FROM
|
|
(
|
|
SELECT
|
|
EventDate,
|
|
count() AS hits
|
|
FROM test.hits
|
|
GROUP BY EventDate
|
|
) ANY LEFT JOIN
|
|
(
|
|
SELECT
|
|
StartDate AS EventDate,
|
|
sum(Sign) AS visits
|
|
FROM test.visits
|
|
GROUP BY EventDate
|
|
) USING EventDate
|
|
ORDER BY hits DESC
|
|
LIMIT 10
|
|
SETTINGS joined_subquery_requires_alias = 0;
|