在 Sybase IQ 中选择列 'Comment' 时出现语法错误
Syntax error when selecting column 'Comment' in Sybase IQ
我有一个 table A,其中包含 Sybase IQ 中的一些列。其中一列名为 "Comment".
每当我select那一栏:
select Comment from A
我收到错误:
[Error Code: 102, SQL State: 42W04] SQL Anywhere Error -131: Syntax error near 'Comment'
我可以 select 其他专栏,没有问题。能告知原因和解决方法吗?谢谢
尝试
select "Comment" from A
COMMENT is a reserved word 在 Sybase IQ 中。
这里是the link explaining your problem。
Some keywords in SQL are also reserved words. To use a reserved word
in a SQL statement as an identifier, you must enclose the word in
double quotes. Many, but not all, of the keywords that appear in SQL
statements are reserved words. For example, you must use the following
syntax to retrieve the contents of a table named SELECT.
SELECT * FROM "SELECT"
我有一个 table A,其中包含 Sybase IQ 中的一些列。其中一列名为 "Comment".
每当我select那一栏:
select Comment from A
我收到错误:
[Error Code: 102, SQL State: 42W04] SQL Anywhere Error -131: Syntax error near 'Comment'
我可以 select 其他专栏,没有问题。能告知原因和解决方法吗?谢谢
尝试
select "Comment" from A
COMMENT is a reserved word 在 Sybase IQ 中。
这里是the link explaining your problem。
Some keywords in SQL are also reserved words. To use a reserved word in a SQL statement as an identifier, you must enclose the word in double quotes. Many, but not all, of the keywords that appear in SQL statements are reserved words. For example, you must use the following syntax to retrieve the contents of a table named SELECT.
SELECT * FROM "SELECT"