mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-11 10:04:06 +00:00
22 lines
326 B
SQL
22 lines
326 B
SQL
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;
|