提交 4299403e 编写于 作者: E Elias Soong

[TD-2571] <docs>: add new keyword DISTINCT to select different values of tag column in super table.

上级 2dd8333c
......@@ -470,6 +470,17 @@ Query OK, 2 row(s) in set (0.003112s)
注意:普通表的通配符 * 中并不包含 _标签列_。
##### 获取标签列的去重取值
从 2.0.15 版本开始,支持在超级表查询标签列时,指定 distinct 关键字,这样将返回指定标签列的所有不重复取值。
```mysql
SELECT DISTINCT tag_name FROM stb_name;
```
注意:目前 distinct 关键字只支持对超级表的标签列进行去重,而不能用于普通列。
#### 结果集列名
```SELECT```子句中,如果不指定返回结果集合的列名,结果集列名称默认使用```SELECT```子句中的表达式名称作为列名称。此外,用户可使用```AS```来重命名返回结果集合中列的名称。例如:
......
......@@ -452,39 +452,39 @@ TDengine的所有可执行文件默认存放在 _/usr/local/taos/bin_ 目录下
| 关键字列表 | | | | |
| ---------- | ----------- | ------------ | ---------- | --------- |
| ABLOCKS | CONNECTION | GT | MNODES | SLIDING |
| ABORT | CONNECTIONS | ID | MODULES | SMALLINT |
| ACCOUNT | COPY | IF | NCHAR | SPREAD |
| ACCOUNTS | COUNT | IGNORE | NE | STABLE |
| ADD | CREATE | IMMEDIATE | NONE | STABLES |
| AFTER | CTIME | IMPORT | NOT | STAR |
| ALL | DATABASE | IN | NOTNULL | STATEMENT |
| ALTER | DATABASES | INITIALLY | NOW | STDDEV |
| AND | DAYS | INSERT | OF | STREAM |
| AS | DEFERRED | INSTEAD | OFFSET | STREAMS |
| ASC | DELIMITERS | INTEGER | OR | STRING |
| ATTACH | DESC | INTERVAL | ORDER | SUM |
| AVG | DESCRIBE | INTO | PASS | TABLE |
| BEFORE | DETACH | IP | PERCENTILE | TABLES |
| BEGIN | DIFF | IS | PLUS | TAG |
| BETWEEN | DIVIDE | ISNULL | PRAGMA | TAGS |
| BIGINT | DNODE | JOIN | PREV | TBLOCKS |
| BINARY | DNODES | KEEP | PRIVILEGE | TBNAME |
| BITAND | DOT | KEY | QUERIES | TIMES |
| BITNOT | DOUBLE | KILL | QUERY | TIMESTAMP |
| BITOR | DROP | LAST | RAISE | TINYINT |
| BOOL | EACH | LE | REM | TOP |
| BOTTOM | END | LEASTSQUARES | REPLACE | TRIGGER |
| BY | EQ | LIKE | REPLICA | UMINUS |
| CACHE | EXISTS | LIMIT | RESET | UPLUS |
| CASCADE | EXPLAIN | LINEAR | RESTRICT | USE |
| CHANGE | FAIL | LOCAL | ROW | USER |
| CLOG | FILL | LP | ROWS | USERS |
| CLUSTER | FIRST | LSHIFT | RP | USING |
| COLON | FLOAT | LT | RSHIFT | VALUES |
| COLUMN | FOR | MATCH | SCORES | VARIABLE |
| COMMA | FROM | MAX | SELECT | VGROUPS |
| COMP | GE | METRIC | SEMI | VIEW |
| CONCAT | GLOB | METRICS | SET | WAVG |
| CONFIGS | GRANTS | MIN | SHOW | WHERE |
| CONFLICT | GROUP | MINUS | SLASH | |
| ABLOCKS | CONNECTION | GROUP | MINUS | SLASH |
| ABORT | CONNECTIONS | GT | MNODES | SLIDING |
| ACCOUNT | COPY | ID | MODULES | SMALLINT |
| ACCOUNTS | COUNT | IF | NCHAR | SPREAD |
| ADD | CREATE | IGNORE | NE | STABLE |
| AFTER | CTIME | IMMEDIATE | NONE | STABLES |
| ALL | DATABASE | IMPORT | NOT | STAR |
| ALTER | DATABASES | IN | NOTNULL | STATEMENT |
| AND | DAYS | INITIALLY | NOW | STDDEV |
| AS | DEFERRED | INSERT | OF | STREAM |
| ASC | DELIMITERS | INSTEAD | OFFSET | STREAMS |
| ATTACH | DESC | INTEGER | OR | STRING |
| AVG | DESCRIBE | INTERVAL | ORDER | SUM |
| BEFORE | DETACH | INTO | PASS | TABLE |
| BEGIN | DIFF | IP | PERCENTILE | TABLES |
| BETWEEN | DISTINCT | IS | PLUS | TAG |
| BIGINT | DIVIDE | ISNULL | PRAGMA | TAGS |
| BINARY | DNODE | JOIN | PREV | TBLOCKS |
| BITAND | DNODES | KEEP | PRIVILEGE | TBNAME |
| BITNOT | DOT | KEY | QUERIES | TIMES |
| BITOR | DOUBLE | KILL | QUERY | TIMESTAMP |
| BOOL | DROP | LAST | RAISE | TINYINT |
| BOTTOM | EACH | LE | REM | TOP |
| BY | END | LEASTSQUARES | REPLACE | TRIGGER |
| CACHE | EQ | LIKE | REPLICA | UMINUS |
| CASCADE | EXISTS | LIMIT | RESET | UPLUS |
| CHANGE | EXPLAIN | LINEAR | RESTRICT | USE |
| CLOG | FAIL | LOCAL | ROW | USER |
| CLUSTER | FILL | LP | ROWS | USERS |
| COLON | FIRST | LSHIFT | RP | USING |
| COLUMN | FLOAT | LT | RSHIFT | VALUES |
| COMMA | FOR | MATCH | SCORES | VARIABLE |
| COMP | FROM | MAX | SELECT | VGROUPS |
| CONCAT | GE | METRIC | SEMI | VIEW |
| CONFIGS | GLOB | METRICS | SET | WAVG |
| CONFLICT | GRANTS | MIN | SHOW | WHERE |
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册