mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
16 lines
271 B
SQL
16 lines
271 B
SQL
SELECT
|
|
EventDate,
|
|
count() AS hits,
|
|
any(visits)
|
|
FROM test.hits ANY LEFT JOIN
|
|
(
|
|
SELECT
|
|
StartDate AS EventDate,
|
|
sum(Sign) AS visits
|
|
FROM test.visits
|
|
GROUP BY EventDate
|
|
) USING EventDate
|
|
GROUP BY EventDate
|
|
ORDER BY hits DESC
|
|
LIMIT 10;
|