clickhouse数据库不支持行号(),正在寻找替代函数。
SELECT company_name AS company,
DOMAIN,
city_name AS city,
state_province_code AS state,
country_code AS country,
location_revenue AS revenueRange,
location_TI_industry AS industry,
location_employeecount_range AS employeeSize,
topic,
location_duns AS duns,
rank AS intensityRank,
dnb_status_code AS locationStatus,
rank_delta AS intensityRankDelta,
company_id,
ROW_NUMBER() OVER (PARTITION BY DOMAIN) AS rowNumberFROM company_intent c
WHERE c.rank > 0
AND c.rank <= 10
AND c.signal_count > 0
AND c.topic IN ('Cloud Computing')
AND c.country_code = 'US'
AND c.rank IN (7, 8, 9, 10)
GROUP BY c.location_duns,
company_name,
DOMAIN,
city_name,
state_province_code,
country_code,
location_revenue,
location_TI_industry,
location_employeecount_range,
topic,
rank,
dnb_status_code,
rank_delta,
company_id
ORDER BY intensityRank DESC
LIMIT 15 SELECT COUNT (DISTINCT c.company_id) AS COUNT
FROM company_intent c
WHERE c.rank > 0
AND c.rank <= 10
AND c.signal_count > 0
AND c.topic IN ('Cloud Computing')
AND c.country_code = 'US'
AND c.rank IN (7, 8, 9, 10)
执行上述查询时,出现以下错误。
应为以下之一:设置、格式、with、having、limit、from、prewhere、token、union all、逗号、where、order by、into outfile、group by
如有任何建议,我们将不胜感激
4条答案
按热度按时间m4pnthwp1#
clickhouse目前不支持窗口功能。有一个rownumberinallblocks函数,您可能会感兴趣。
pw9qyyiw2#
https://clickhouse-docs.readthedocs.io/en/latest/functions/other_functions.html 说:
rownumberinallblocks()返回此函数处理的所有块中的增量行号。
zxlwwiss3#
像这样的smth(很糟糕,但效果很好)
unftdfkk4#