MATCH (n:Person)
RETURN count(n) as user_counts,
sum(case when n.active then 1 end) as active,
sum(case when not n.active then 1 end) as inactive,
sum(case when n.active is NULL then 1 end) as no_info
Match(p:Persons)`
RETURN count(p) as total_user,
sum(case when not p.active then 1 end) as inactive_users,
sum(case when p.active then 1 end) as active_users,
sum(case when p.active is NULL then 1 end) as remaining_users
2条答案
按热度按时间t0ybt7op1#
下面是活动用户和非活动用户的计数。它类似于SQL,其中使用了sum()函数和条件子句“case when”。
使用影片数据库中的Persons节点的示例结果
f0brbegy2#
我们可以简单地用途: