Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-28-2021 11:40 PM
Hello,
I need some help to create a cypher query.
For all different values of property "job", the query shall return the property name and the amount of nodes that have this property value.
Sample data:
CREATE (:Person {age: 20, job: "SW engineer"})
CREATE (:Person {age: 21, job: "HW engineer"})
CREATE (:Person {age: 22, job: "SW engineer"})
CREATE (:Person {age: 40, job: "boss"})
CREATE (:Person {age: 40, job: "architect"})
CREATE (:Person {age: 99, job: "boss"})
CREATE (:Person {age: 30, job: "boss"})
Expected output:
Job | count
____________________________
SW engineer | 2
HW engineer | 1
boss | 3
architect | 1
Any ideas?
Solved! Go to Solution.
07-28-2021 11:44 PM
Hello @hafeja and welcome to the Neo4j community
MATCH (p:Person)
RETURN p.job AS job, count(p.job) AS count
Regards,
Cobra
07-28-2021 11:44 PM
Hello @hafeja and welcome to the Neo4j community
MATCH (p:Person)
RETURN p.job AS job, count(p.job) AS count
Regards,
Cobra
07-28-2021 11:49 PM
Wow! Thank you for the super fast reply!
All the sessions of the conference are now available online