neo4j如何使用有条件的地方
我有以下查询:
MATCH (u: User {id: '...'})-[r:EXECUTING]->(journey: Journey)
WHERE r.progress > 0 AND r.progress < 100
RETURN journey;
它加载了用附加到用户的所有旅程:执行
,如果关系的prempress
属性在1到100之间。
现在我想添加一个和
- &gt;因此,<代码>其中仅应为r.progress&gt; 0
(没有和
...)。 我看到//
然后
时,有case
/,但认为必须有更快的解决方案?
则应检查R.Progress在0到50之间。如果变量为trui,则应将R.Progress检查为0到100之间。
示例“如果某个变量为false ,
I have the following query:
MATCH (u: User {id: '...'})-[r:EXECUTING]->(journey: Journey)
WHERE r.progress > 0 AND r.progress < 100
RETURN journey;
It loads all journeys that are attached to a user with :EXECUTING
if the relationship's progress
property is between 1 and 100.
Now I want to add a condition for the part behind the AND
--> so the WHERE
should only be r.progress > 0
(without the AND
...).
I saw that there are CASE
/WHEN
/THEN
but think that there must be a quicker solution?
Example "The where should check r.progress to be between 0 and 50 if a certain variable is false. If the variable is true, it should check r.progress to be between 0 and 100"
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您的描述
。其中子句:
但不确定它比案例/何时“快”。
Based on your description
I'd write the following
WHERE
clause:But not sure it is "quicker" than a CASE/WHEN.