Die Seite "支持的SQL语法"
wird gelöscht. Bitte seien Sie vorsichtig.
查询语句中必须加key的where条件,因为dtc是key-value缓存服务。
select * from opensource where uid = 1
通配符星号(*)查询所有字段select uid, name from opensource where uid = 1
查询部分字段select * from opensource where uid =1 and name = 'dtc'
AND符号select * from opensource where uid =1 and name = 'dtc'
字符串类型支持单引号select * from opensource where uid = 1 and age > 18
数字类型支持大于符号select * from opensource where uid = 1 and age >= 18
数字类型支持大于等于符号select * from opensource where uid = 1 and age < 18
数字类型支持小于符号select * from opensource where uid = 1 and age <= 18
数字类型支持大于等于符号select * from opensource where uid = 1 and age != 18
数字类型支持不等于符号select * from opensource where uid = 1 limit 1
支持关键字limit返回指定条数的结果select * from opensource where uid = 1 limit 1,3
支持limit(start, offset)的用法count() 不支持计数函数
insert into opensource(uid, name) values(1, 'hello')
指定字段插入数据
insert into opensource set uid = 33, name = 'hello'
set形式的插入操作
"insert into opensource(uid,name,city,sex,age) values(1, 123, 'Shanghai', 1, 18)
类型自动兼容,name定义为string,但插入数字类型,会自动转换成字符串
insert into opensource(uid,name,city,sex,age) values(2, 'jack', 'Shanghai', 1, '18')
类型自动兼容,string转int
insert into opensource(uid, name) values(33, \"hello\")
字符串支持单引号和双引号
insert into
opensource
(uid, name) values(33, 'hello')
表名、字段名支持重力符号(实际应为一个重力符号,由于显示问题打印两次)
update opensource set name = 'Lee' where uid = 1
更新操作的常规语法,其他规则和上述相同。delete from opensource where uid = 1
删除操作的常规语法,其他规则和上述相同。Die Seite "支持的SQL语法"
wird gelöscht. Bitte seien Sie vorsichtig.