如何找到所有标签和计数在AgensGraph上获取的顶点?

时间:2019-07-31 06:32:13

标签: agens-graph

我想按标签列出提取的顶点。

如何找到获取的顶点的所有标签和计数?

1 个答案:

答案 0 :(得分:0)

将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)