cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

What is wrong in this quey

Hi
With this query I'm getting this error
MATCH (o:Order)-[cont:CONTAINS]->(p:Product)-[r:PART_OF]->(c:Category)
where EXISTS {
(MATCH (:Supplier)-[:SUPPLIES]->(p))}
RETURN p.productName,cont.unitPrice;

Neo.ClientError.Statement.SyntaxError
Neo.ClientError.Statement.SyntaxError: Invalid input ':': expected whitespace, DISTINCT, an expression or ')' (line 3, column 9 (offset: 94))
" MATCH (:Supplier)-[:SUPPLIES]->(p))"
^

Any help?

Regards

1 ACCEPTED SOLUTION

Yes, subqueries have appeared with 4.0.

View solution in original post

8 REPLIES 8

It's the extra set of ( ) inside of the EXISTS that is causing an error. The open parenthesis (introduces an expression but MATCH is a clause.

Instead, try:

MATCH (o:Order)-[cont:CONTAINS]->(p:Product)-[r:PART_OF]->(c:Category)
where EXISTS {
    MATCH (:Supplier)-[:SUPPLIES]->(p)
}
RETURN p.productName,cont.unitPrice

Best,
ABK

Still getting the error

Which version of Neo4j database do you use?

Neo4j Browser version: 3.2.20

Neo4j Server version: 3.5.8 (community)

This version of Neo4j doesn't support this syntax, you will have tu upgrade to the 4.0 at least to use it.

Hi.

I think what happens with CALL error is the same for this version.

Yes, subqueries have appeared with 4.0.

Many thanks for your help!