2018-08-07 17:08:51 +00:00
|
|
|
SELECT
|
2018-12-29 22:11:00 +00:00
|
|
|
EventDate,
|
2018-08-07 17:08:51 +00:00
|
|
|
hits,
|
|
|
|
visits
|
|
|
|
FROM
|
|
|
|
(
|
|
|
|
SELECT
|
2018-12-29 22:11:00 +00:00
|
|
|
EventDate,
|
2018-08-07 17:08:51 +00:00
|
|
|
count() AS hits
|
|
|
|
FROM test.hits
|
2018-12-29 22:11:00 +00:00
|
|
|
GROUP BY EventDate
|
2018-08-07 17:08:51 +00:00
|
|
|
) ANY LEFT JOIN
|
|
|
|
(
|
|
|
|
SELECT
|
2018-12-29 22:11:00 +00:00
|
|
|
StartDate AS EventDate,
|
2018-08-07 17:08:51 +00:00
|
|
|
sum(Sign) AS visits
|
|
|
|
FROM test.visits
|
2018-12-29 22:11:00 +00:00
|
|
|
GROUP BY EventDate
|
|
|
|
) USING EventDate
|
2018-08-07 17:08:51 +00:00
|
|
|
ORDER BY hits DESC
|
2019-08-29 18:45:34 +00:00
|
|
|
LIMIT 10
|
2019-09-02 12:53:31 +00:00
|
|
|
SETTINGS joined_subquery_requires_alias = 0;
|