简体   繁体   中英

How to find all labels and counts fetched vertex on AgensGraph?

I want to list fetched vertex by label.

How can I find all labels and counts of fetched vertex?

Use LABLE function with distinct keyword.

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM