cancel
Showing results for 
Search instead for 
Did you mean: 

What is wrong in this quey

jomarca11
Node

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

abk
Neo4j
Neo4j

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

Cobra
Ninja
Ninja

Which version of Neo4j database do you use?

jomarca11
Node

Neo4j Browser version: 3.2.20

Neo4j Server version: 3.5.8 (community)

Cobra
Ninja
Ninja

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

jomarca11
Node

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!