【发布时间】:2017-11-19 15:55:42
【问题描述】:
您好,我在 neo4j 上遇到了一些麻烦
// 1. Find the most_popular_cuisine
MATCH (n:restaurants)
WITH COUNT(n.cuisine) as total
MATCH (r:restaurants)
RETURN r.cuisine , 100 * count(*)/total as percentage
order by percentage desc
limit 1
我正在尝试通过获取顶部结果并与之匹配以获取仅具有该属性的节点,从而进一步扩展它
WITH COUNT(n.cuisine) as total
MATCH (r:restaurants)
WITH r.cuisine as cuisine , count(*) as cnt
MATCH (t:restaurants)
WHERE t.cuisine = cuisine AND count(*) = MAX(cnt)
RETURN t
【问题讨论】: