I recently found the select syntax in TDengine SQL is slightly different from mysql due to stable. But I cannot give a reasonable explanation. Let me show the emample: Here is the stable structure:
describe mystable;
Field | Type | Length | Note |
=================================================================================
ts | TIMESTAMP | 8 | |
value | DOUBLE | 8 | |
tag1 | NCHAR | 16 | TAG |
tag2 | NCHAR | 43 | TAG |
tag3 | NCHAR | 29 | TAG |
tag4 | NCHAR | 10 | TAG |
tag5 | NCHAR | 2 | TAG |
When I execute:
select count(*) from mystable
count(*) |
========================
270419 |
And count on a colume, the result should be the same:
select count(value) from mystable
count(value) |
========================
270419 |
However, When count on a tag, the results is different:
select count(tag1) from mystable
count(tag1) |
========================
13 |
So what does select(tag_name) actually means in TDengine sql?