Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
89764e28
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
未验证
提交
89764e28
编写于
5月 29, 2022
作者:
W
wade zhang
提交者:
GitHub
5月 29, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13183 from taosdata/docs/cdiwadkar16-patch-4-29
docs:cdiwadkar16-patch-4-29 - minor
上级
f8f44d39
a7918f9a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
13 deletion
+13
-13
docs-en/12-taos-sql/10-json.md
docs-en/12-taos-sql/10-json.md
+13
-13
未找到文件。
docs-en/12-taos-sql/10-json.md
浏览文件 @
89764e28
...
...
@@ -4,7 +4,7 @@ title: JSON Type
## Syntax
1.
Tag of
JSON type
1.
Tag of
type JSON
```
sql
create
STable
s1
(
ts
timestamp
,
v1
int
)
tags
(
info
json
);
...
...
@@ -12,7 +12,7 @@ title: JSON Type
create
table
s1_1
using
s1
tags
(
'{"k1": "v1"}'
);
```
2.
->
Operator of JSON
2.
"->"
Operator of JSON
```
sql
select
*
from
s1
where
info
->
'k1'
=
'v1'
;
...
...
@@ -20,7 +20,7 @@ title: JSON Type
select
info
->
'k1'
from
s1
;
```
3.
contains
Operator of JSON
3.
"contains"
Operator of JSON
```
sql
select
*
from
s1
where
info
contains
'k2'
;
...
...
@@ -30,7 +30,7 @@ title: JSON Type
## Applicable Operations
1.
When JSON data type is used in
`where`
,
`match/nmatch/between and/like/and/or/is null/is no null`
can be used but
`in`
can't be used.
1.
When
a
JSON data type is used in
`where`
,
`match/nmatch/between and/like/and/or/is null/is no null`
can be used but
`in`
can't be used.
```
sql
select
*
from
s1
where
info
->
'k1'
match
'v*'
;
...
...
@@ -42,9 +42,9 @@ title: JSON Type
select
*
from
s1
where
info
->
'k1'
is
not
null
;
```
2.
Tag of JSON type can be used in
`group by`
,
`order by`
,
`join`
,
`union all`
and sub query,
for example
`group by json->'key'`
2.
A tag of JSON type can be used in
`group by`
,
`order by`
,
`join`
,
`union all`
and sub query;
for example
`group by json->'key'`
3.
`Distinct`
can be used with
tag of JSON type
3.
`Distinct`
can be used with
a tag of type JSON
```
sql
select
distinct
info
->
'k1'
from
s1
;
...
...
@@ -52,9 +52,9 @@ title: JSON Type
4.
Tag Operations
The value of JSON tag can be altered. Please note that the full JSON will be overriden when doing this.
The value of
a
JSON tag can be altered. Please note that the full JSON will be overriden when doing this.
The name of JSON tag can be altered. A tag of JSON type can't be added or removed. The column length of a JSON tag can't be changed.
The name of
a
JSON tag can be altered. A tag of JSON type can't be added or removed. The column length of a JSON tag can't be changed.
## Other Restrictions
...
...
@@ -64,17 +64,17 @@ title: JSON Type
-
JSON format:
-
The input string for JSON can be empty, i.e. "", "
\t
", or NULL, but can't be non-NULL string, bool or array.
-
object can be {}, and the
whol
e JSON is empty if so. Key can be "", and it's ignored if so.
-
value can be int, double, string, bo
ll or NULL, can't be array. Nesting is not allowed, that means value can't be another
JSON.
-
The input string for JSON can be empty, i.e. "", "
\t
", or NULL, but
it
can't be non-NULL string, bool or array.
-
object can be {}, and the
entir
e JSON is empty if so. Key can be "", and it's ignored if so.
-
value can be int, double, string, bo
ol or NULL, and it can't be an array. Nesting is not allowed which means that the value of a key can't be
JSON.
-
If one key occurs twice in JSON, only the first one is valid.
-
Escape characters are not allowed in JSON.
-
NULL is returned
if
querying a key that doesn't exist in JSON.
-
NULL is returned
when
querying a key that doesn't exist in JSON.
-
If a tag of JSON is the result of inner query, it can't be parsed and queried in the outer query.
For example, the
below SQL statements
are not supported.
For example, the
SQL statements below
are not supported.
```
sql;
select jtag->'key' from (select jtag from STable);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录