mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 17:44:23 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
23 lines
374 B
SQL
23 lines
374 B
SQL
SELECT
|
|
domain,
|
|
hits,
|
|
visits
|
|
FROM
|
|
(
|
|
SELECT
|
|
domain(URL) AS domain,
|
|
count() AS hits
|
|
FROM test.hits
|
|
GROUP BY domain
|
|
) ANY LEFT JOIN
|
|
(
|
|
SELECT
|
|
domain(StartURL) AS domain,
|
|
sum(Sign) AS visits
|
|
FROM test.visits
|
|
GROUP BY domain
|
|
) USING domain
|
|
ORDER BY hits DESC
|
|
LIMIT 10
|
|
SETTINGS joined_subquery_requires_alias = 0;
|