In SQL you can use variables previously defined with
AS in subsequent clause, but Cypher doesn't seem to support that.
in this (contrived) example, this doesn't work. The
substr() won't accept
WITH p.name AS fullname, substr(fullname, 0, 5) AS nickname
The work around is to use two
WITH statements (which is a bit uglier):
WITH p.name AS fullname WITH fullname, substr(fullname, 0, 5) AS nickname
It would be nice if Cypher could support this.