Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-15-2021 01:18 AM
Hi All
How can I query this? with subqueries?
I'm trying this
MATCH (o:Order)-[cont:CONTAINS]->(p:Product)-[r:PART_OF]->(c:Category)
where EXISTS {
(MATCH (:Supplier)-[:SUPPLIES]->(p))}
RETURN p.productName,cont.unitPrice;
But I get an error.
Kind Regards
Solved! Go to Solution.
12-17-2021 07:36 AM
Maybe this query should be fine for your case?
MATCH (o:Order)-[cont:CONTAINS]->(p:Product)-[r:PART_OF]->(c:Category),
(supplier:Supplier)-[:SUPPLIES]->(p)
// optional WHERE part
RETURN p.productName, p.unitPrice
12-15-2021 02:01 AM
Hello @jomarca11
This should be enough normally:
MATCH (o:Order)-[cont:CONTAINS]->(p:Product)-[r:PART_OF]->(c:Category)
WHERE EXISTS((:Supplier)-[:SUPPLIES]->(p))
RETURN p.productName, cont.unitPrice;
Regards,
Cobra
12-15-2021 02:24 AM
Hi.
It should be right if I did not need to check a property from Supplier. That's why I tried with the MATCH clause
Regards
12-17-2021 07:36 AM
Maybe this query should be fine for your case?
MATCH (o:Order)-[cont:CONTAINS]->(p:Product)-[r:PART_OF]->(c:Category),
(supplier:Supplier)-[:SUPPLIES]->(p)
// optional WHERE part
RETURN p.productName, p.unitPrice
All the sessions of the conference are now available online