I'm trying to query a collection for some documents where one of the fields happens to be named 'top'. However, I can't directly reference this column in a select statement because the name conflicts with the TOP keyword. For example:
SELECT C.code, C.top FROM c
This throws the following error - "Syntax error, incorrect syntax near 'top'."
Is there anything I can do to escape this field name, or will I have to rename the field to something else?
top is a reserved keyword. To escape this use [""]
syntax.
SELECT c.code,c["top"] FROM c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With