TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

select count improvement

Open PascalMing opened this issue 5 years ago • 1 comments

TDengine 2.0.11环境 use log; select X from dn; X为任意数字,包括0,可以显示有多少条记录,每条记录值为X

但是 select count(X) from dn; X只能为1,不允许其他值。 这个与mysql不一致,在逻辑上也不自洽,建议改进

查询示例如下:

taos> select 0 from dn; 0 |

                 0 |
                 0 |

。。。。。 0 | 0 | Query OK, 27 row(s) in set (0.012902s)

taos> select count(0) from dn;

DB error: invalid SQL: illegal column name (0.005119s) taos> select count(1) from dn; count(1) |

                27 |

Query OK, 1 row(s) in set (0.016144s)

PascalMing avatar Dec 22 '20 15:12 PascalMing

我们知道有这个问题,后面会修复这个问题。谢谢!

hjxilinx avatar Dec 25 '20 05:12 hjxilinx