查询时报错:Two objects in an expression must be connected by an operator.

t = table(1..5 as `202120, 1..5 as value)
select round(202120, 4) 202120 from t

报错:Syntax Error: [line #51] Two objects in an expression must be connected by an operator. Object 1: round(202120, 4)  Object 2: 202120

请先 登录 后评论

1 个回答

Juntao Wang

包含特殊符号或以数字开头的列名在 SQL 中引用时,需将列名用双引号引用,并在其之前使用下划线作为标识,例如:_"IBM.N", _"000001.SH"。详见:https://www.dolphindb.cn/cn/help/130/DataTypesandStructures/DataForms/Table.html

以上脚本可以改为:

t = table(1..5 as `202120, 1..5 as value)
select round(_"202120", 4) `202120 from t


请先 登录 后评论