Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-11-2020 02:51 PM
Hello,
When using SIngle quote character or double-quote character for aliases, I get the below error. But on the online training page 'Cypher' under the category 'Specifying aliases', it is mentioned that we can use a single quote or double quote. Also, I believe the instructor has used a single-quote character in the video (unless it is backtick)
Error:
Neo.ClientError.Statement.SyntaxError: Invalid input '"': expected whitespace, comment or a variable (line 1, column 95 (offset: 94))
"MATCH (m:Movie {released:2006}) return m.title as Title, m.tagline as Tagline, m.released as "Released""
Many Thanks,
Neel
03-11-2020 03:28 PM
Hello Neelkanth,
You must use a backtic character for aliases that contain spaces.
With respect to values for properties, you can use either a single quote or a double quote.
Elaine
03-11-2020 03:44 PM
Thanks, Elaine
But what if the aliases do not contain spaces, can one use single quote or double quotes then?
Kind regards,
Neel
03-11-2020 03:55 PM
I believe you just need to put an = sign instead of the AS . I too am new.
03-11-2020 04:03 PM
Actually that was wrong on my part. I just retyped the part that says MATCH (m:Movie {released:2006}) return m.title as Title, m.tagline as Tagline, m.released as Released and it worked.
03-11-2020 04:10 PM
Yes, so what I understand is:
1> If aliases contain space use backtick
2> If aliases do not contain space don't use backtick, instead leave as is.
Hence, on the online training webpage, according to me the below text is misguiding. It sounds like if you have space between string use backtick else you can use a single or double quote character (as they say 'rather than').
If you want a heading to contain a space between strings, you must specify the alias with the back tick character, rather than a single or double quote character
Neel
All the sessions of the conference are now available online