Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2449c6ed
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2449c6ed
编写于
12月 05, 2021
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add rawsql the second version
上级
6737952e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
137 addition
and
0 deletion
+137
-0
tests/pytest/stable/json_tag2.rawsql
tests/pytest/stable/json_tag2.rawsql
+137
-0
未找到文件。
tests/pytest/stable/json_tag2.rawsql
0 → 100644
浏览文件 @
2449c6ed
drop database db;
create database db;
use db;
create table if not exists jsons1(ts timestamp, dataInt int, dataBool bool, dataStr nchar(50), dataStrBin binary(150)) tags(jtag json)
insert into jsons1_1 using jsons1 tags('{\"tag1\":\"fff\",\"tag2\":5, \"tag3\":true}') values(1591060618000, 1, false, 'json1', '你是') (1591060608000, 23, true, '等等', 'json')
insert into jsons1_2 using jsons1 tags('{\"tag1\":5,\"tag2\":\"beijing\"}') values (1591060628000, 2, true, 'json2', 'sss')
insert into jsons1_3 using jsons1 tags('{\"tag1\":false,\"tag2\":\"beijing\"}') values (1591060668000, 3, false, 'json3', 'efwe')
insert into jsons1_4 using jsons1 tags('{\"tag1\":null,\"tag2\":\"shanghai\",\"tag3\":\"hello\"}') values (1591060728000, 4, true, 'json4', '323sd')
insert into jsons1_5 using jsons1 tags('{\"tag1\":1.232, \"tag2\":null}') values(1591060928000, 1, false, '你就会', 'ewe')
insert into jsons1_6 using jsons1 tags('{\"tag1\":11,\"tag2\":\"\",\"tag2\":null}') values(1591061628000, 11, false, '你就会','')
insert into jsons1_7 using jsons1 tags('{\"tag1\":\"收到货\",\"tag2\":\"\",\"tag3\":null}') values(1591062628000, 2, NULL, '你就会', 'dws')
CREATE TABLE if not exists jsons1_8 using jsons1 tags('{\"tag1\":null, \"tag1\":true, \"tag1\":45, \"1tag$\":2, \" \":90}')
insert into jsons1_9 using jsons1 tags('\t') values (1591062328000, 24, NULL, '你就会', '2sdw')
CREATE TABLE if not exists jsons1_10 using jsons1 tags('')
CREATE TABLE if not exists jsons1_11 using jsons1 tags(' ')
CREATE TABLE if not exists jsons1_12 using jsons1 tags('{}')
CREATE TABLE if not exists jsons1_13 using jsons1 tags('null')
ALTER TABLE jsons1_1 SET TAG jtag='{\"tag1\":\"femail\",\"tag2\":35,\"tag3\":true}'
select dataint from jsons1
select * from jsons1
select jtag from jsons1
select jtag from jsons1 where jtag is null
select jtag from jsons1 where jtag is not null
select jtag from jsons1_8
select jtag from jsons1_1
select jtag from jsons1_9
select jtag->'tag1' from jsons1_1
select jtag->'tag2' from jsons1_6
select jtag->'tag2' from jsons1_1
select jtag->'tag3' from jsons1_1
select jtag->'tag1' from jsons1_4
select jtag->'tag1' from jsons1_5
select jtag->'tag10' from jsons1_4
#select jtag->'tag1' from jsons1
#select * from jsons1 where jtag->'tag2'='beijing'
#select dataint,tbname,jtag->'tag1',jtag from jsons1 where jtag->'tag2'='beijing'
select * from jsons1 where jtag->'tag1'='beijing'
select * from jsons1 where jtag->'tag1'='收到货'
select * from jsons1 where jtag->'tag2'>'beijing'
select * from jsons1 where jtag->'tag2'>='beijing'
select * from jsons1 where jtag->'tag2'<'beijing'
select * from jsons1 where jtag->'tag2'<='beijing'
select * from jsons1 where jtag->'tag2'!='beijing'
select * from jsons1 where jtag->'tag2'=''
select * from jsons1 where jtag->'tag1'=5
select * from jsons1 where jtag->'tag1'=10
select * from jsons1 where jtag->'tag1'<54
select * from jsons1 where jtag->'tag1'<=11
select * from jsons1 where jtag->'tag1'>4
select * from jsons1 where jtag->'tag1'>=5
select * from jsons1 where jtag->'tag1'!=5
select * from jsons1 where jtag->'tag1'!=55
select * from jsons1 where jtag->'tag1'=1.232
select * from jsons1 where jtag->'tag1'<1.232
select * from jsons1 where jtag->'tag1'<=1.232
select * from jsons1 where jtag->'tag1'>1.23
select * from jsons1 where jtag->'tag1'>=1.232
select * from jsons1 where jtag->'tag1'!=1.232
select * from jsons1 where jtag->'tag1'!=3.232
select * from jsons1 where jtag->'tag1'=true
select * from jsons1 where jtag->'tag1'=false
select * from jsons1 where jtag->'tag1'!=false
select * from jsons1 where jtag->'tag1'=null
select * from jsons1 where jtag is null
select * from jsons1 where jtag is not null
select * from jsons1 where jtag->'tag_no_exist'=3
select * from jsons1 where jtag->'tag1' is null
select * from jsons1 where jtag->'tag4' is null
select * from jsons1 where jtag->'tag3' is not null
select * from jsons1 where jtag?'tag1'
select * from jsons1 where jtag?'tag3'
select * from jsons1 where jtag?'tag_no_exist'
select * from jsons1 where jtag->'tag1'=false and jtag->'tag2'='beijing'
select * from jsons1 where jtag->'tag1'=false or jtag->'tag2'='beijing'
select * from jsons1 where jtag->'tag1'=false and jtag->'tag2'='shanghai'
select * from jsons1 where jtag->'tag1'=false and jtag->'tag2'='shanghai'
select * from jsons1 where jtag->'tag1'=13 or jtag->'tag2'>35
select * from jsons1 where jtag->'tag1'=13 or jtag->'tag2'>35
select * from jsons1 where jtag->'tag1' is not null and jtag?'tag3'
select * from jsons1 where jtag->'tag1'='femail' and jtag?'tag3'
select * from jsons1 where tbname = 'jsons1_1'
select * from jsons1 where tbname = 'jsons1_1' and jtag?'tag3'
select * from jsons1 where tbname = 'jsons1_1' and jtag?'tag3' and dataint=3
select * from jsons1 where tbname = 'jsons1_1' and jtag?'tag3' and dataint=23
select *,tbname from jsons1 where jtag->'tag2' like 'bei%'
select *,tbname from jsons1 where jtag->'tag1' like 'fe%' and jtag->'tag2' is not null
select * from jsons1 where jtag->'tag1' match 'ma'
select * from jsons1 where jtag->'tag1' match 'ma$'
select * from jsons1 where jtag->'tag2' match 'jing$'
select * from jsons1 where jtag->'tag1' match '收到'
insert into jsons1_14 using jsons1 tags('{\"tag1\":\"收到货\",\"tag2\":\"\",\"tag3\":null}') values(1591062628000, 2, NULL, '你就会', 'dws')
select distinct jtag->'tag1' from jsons1
select distinct jtag from jsons1
INSERT INTO jsons1_15 using jsons1 tags('{\"tbname\":\"tt\",\"databool\":true,\"datastr\":\"是是是\"}') values(1591060828000, 4, false, 'jjsf', \"你就会\
select *,tbname,jtag from jsons1 where jtag->'datastr' match '是' and datastr match 'js'
select tbname,jtag->'tbname' from jsons1 where jtag->'tbname'='tt' and tbname='jsons1_14'
create table if not exists jsons2(ts timestamp, dataInt int, dataBool bool, dataStr nchar(50), dataStrBin binary(150)) tags(jtag json)
insert into jsons2_1 using jsons2 tags('{\"tag1\":\"fff\",\"tag2\":5, \"tag3\":true}') values(1591060618000, 2, false, 'json2', '你是2')
insert into jsons2_2 using jsons2 tags('{\"tag1\":5,\"tag2\":null}') values (1591060628000, 2, true, 'json2', 'sss')
create table if not exists jsons3(ts timestamp, dataInt int, dataBool bool, dataStr nchar(50), dataStrBin binary(150)) tags(jtag json)
insert into jsons3_1 using jsons3 tags('{\"tag1\":\"fff\",\"tag2\":5, \"tag3\":true}') values(1591060618000, 3, false, 'json3', '你是3')
insert into jsons3_2 using jsons3 tags('{\"tag1\":5,\"tag2\":\"beijing\"}') values (1591060638000, 2, true, 'json3', 'sss')
select 'sss',33,a.jtag->'tag3' from jsons2 a,jsons3 b where a.ts=b.ts and a.jtag->'tag1'=b.jtag->'tag1'
select count(*) from jsons1 group by jtag->'tag1' order by jtag->'tag1' desc
select count(*) from jsons1 group by jtag->'tag1' order by jtag->'tag1' asc
select stddev(dataint) from jsons1 group by jtag->'tag1'
select top(dataint,100) from jsons1 group by jtag->'tag1'
select * from (select jtag, dataint from jsons1)
select jtag->'tag1' from (select jtag->'tag1', dataint from jsons1)
select ts,tbname,jtag->'tag1' from (select jtag->'tag1',tbname,ts from jsons1 order by ts)
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录