SQL starts with the result you want — we SELECT
what we want and then
declare how to source it. In Cypher, the START
clause is quite a
different concept which specifies starting points in the graph from which
the query will execute.
From a SQL point of view, the identifiers in START
are like table names
that point to a set of nodes or relationships. The set can be listed
literally, come via parameters, or as I show in the following example, be
defined by an index look-up.
So in fact rather than being SELECT
-like, the START
clause is
somewhere between the FROM
and the WHERE
clause in SQL.
SQL Query.
SELECT * FROM "Person" WHERE name = 'Anakin'
NAME | ID | AGE | HAIR |
---|---|---|---|
1 rows | |||
|
|
|
|
Cypher Query.
START person=node:Person(name = 'Anakin') RETURN person
person |
---|
1 row |
|
Cypher allows multiple starting points. This should not be strange from a SQL perspective — every table in the FROM
clause is another starting point.
Copyright © 2013 Neo Technology