SequoiaDB 简介
安装部署
数据库实例
分布式引擎
SAC 管控中心
参考手册
常见问题及解答(FAQ)
版本信息
SequoiaDB 巨杉数据库内置 SQL 支持算术表达式和比较表达式。
<field1_name> <mathematical_operator> <value>
Note:
支持复合运算,如 select ( a + 1 ) * ( a - 1 ), b + 1 from sample.employee
age 字段值+1
age + 1
取集合中age字段,age 值+1
> db.exec( "select age + 1 from sample.employee" ) { "age": 12 }
<field1_name> <comparison_operator> <value | field2_name>
<field1_name> <comparison_operator> <value> <logical_operator> <field1_name> <comparison_operator> <value>
age 字段大于 11
age > 11
查询匹配 age 大于 11 的记录
> db.exec( "select * from sample.employee where age > 11" ) { "_id": { "$oid": "5aa3330fdc5673331f000000" }, "name": "Lucy", "age": 12 }
age 字段大于等于 11,且 name 为“Harry”
age >= 11 AND name = 'Harry'
查询匹配 age 大于等于 11,且 name 为“Harry”的记录
> db.exec( "select * from sample.employee where age >= 11 AND name = 'Harry'" ) { "_id": { "$oid": "5aa35dbedc5673331f000001" }, "name": "Harry", "age": 11 }