| 12345678910111213141516171819202122232425262728293031 |
- -- ============================================================
- -- Cypher 子查询测试
- -- ============================================================
- -- 1. Cypher 子查询 - where in match
- match (a:test_graph) -[:connect]-> (b:test_graph) where a.g_name in (match (n:test_graph) where n.g_type='type_a' return n.g_name) return a, b
- /**
- output()
- **/
- ;
- -- 2. Cypher 嵌套子查询
- match (a:test_graph) where a.g_value = (match (n:test_graph) where n.g_name='node_c' return max(n.g_value)) return a
- /**
- output()
- **/
- ;
- -- 3. Cypher 聚合子查询
- match (a:test_graph) where a.g_type='type_a' return a.g_type, count(*)
- /**
- output()
- **/
- ;
- -- 4. Cypher 带 limit 的子查询
- match (a:test_graph) return a limit 3
- /**
- output()
- **/
- ;
|