Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
示例查询
START n = node(*) RETURN n ORDER BY n.activeTo DESC
但 n.activeTo = 0 表示目前处于活动状态。这行应该是第一行。在 SQL 顺序是
ORDER BY IF(activeTo = 0, 0, 1) ASC, activeTo DESC
如何用 Cypher 编写它?
您可以在 ORDER BY 子句中使用CASE子句:
START n = node(*) RETURN n ORDER BY CASE n.activeTo WHEN 0 THEN 0 ELSE 1 END ASC, n.activeTo DESC
我在这里设置了一个示例控制台。