【发布时间】:2017-10-16 07:25:10
【问题描述】:
我很难使用 -e 选项执行,列名用引号括起来。
我想使用 unix 级别执行以下操作。试图从 shell 脚本运行。当我尝试将我的值放在引号中时,它会取消我专栏的引号。
select * from keyspace.cf where "columnname"=''
试过这个:
cqlsh hostname -e "select * from keyspace.cf where "columnname"=''"
它执行为 cqlsh hostname -e 'select * from keyspace.cf where columnname='
stdin>:1:InvalidRequest: Error from server: code=2200 [Invalid query] message="Undefined name columnaname in where clause ('columnname= 'value'')"
【问题讨论】:
-
为什么要用引号括起来列名?你的表架构是什么?
-
cqlsh hostname -e "select * from keyspace.cf where columnname='' "... 列名不需要双引号(除非列名是大写字母)