我想按标签列出获取的顶点。
如何找到所有标签和提取顶点的计数?
使用带有 distinct 关键字的 LABLE 函数。
agens=# match (f)-[:mgr]->(t) return distinct label(f), label(t);
label | label
-------------+------------
"analyst" | "clerk"
"manager" | "analyst"
"manager" | "clerk"
"manager" | "salesman"
"president" | "manager"
(5 rows)
agens=# match (f)-[:mgr]->(t) return label(f) , label(t), count(*);
label | label | count
-------------+------------+-------
"analyst" | "clerk" | 2
"manager" | "analyst" | 2
"manager" | "clerk" | 2
"manager" | "salesman" | 4
"president" | "manager" | 3
(5 rows)