You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/06/18 12:56:31 UTC

[GitHub] [shardingsphere] kimmking edited a comment on issue #4680: count(distinct col) renturn null

kimmking edited a comment on issue #4680:
URL: https://github.com/apache/shardingsphere/issues/4680#issuecomment-645998081


   I will fix to show:
   ```
   mysql> select avg(distinct id),name from test;
   +--------------------------------+------+
   | AGGREGATION_DISTINCT_DERIVED_0 | name |
   +--------------------------------+------+
   |                           NULL | NULL |
   +--------------------------------+------+
   1 row in set (0.04 sec)
   
   mysql> select sum(distinct id),name from test;
   +--------------------------------+------+
   | AGGREGATION_DISTINCT_DERIVED_0 | name |
   +--------------------------------+------+
   |                           NULL | NULL |
   +--------------------------------+------+
   1 row in set (0.02 sec)
   
   mysql> select count(distinct id),name from test;
   +--------------------------------+------+
   | AGGREGATION_DISTINCT_DERIVED_0 | name |
   +--------------------------------+------+
   |                              0 | NULL |
   +--------------------------------+------+
   1 row in set (0.01 sec)
   
   mysql> select min(distinct id),name from test;
   +--------------------------------+------+
   | AGGREGATION_DISTINCT_DERIVED_0 | name |
   +--------------------------------+------+
   |                           NULL | NULL |
   +--------------------------------+------+
   1 row in set (0.02 sec)
   
   mysql>
   mysql> select max(distinct id),name from test;
   +--------------------------------+------+
   | AGGREGATION_DISTINCT_DERIVED_0 | name |
   +--------------------------------+------+
   |                           NULL | NULL |
   +--------------------------------+------+
   1 row in set (0.01 sec)
   
   
   mysql> select max(distinct id) as a,name from test;
   +---+------+
   | a | name |
   +---+------+
   | NULL | NULL |
   +---+------+
   1 row in set (0.02 sec)
   
   mysql> select count(distinct id) as a,name from test;
   +---+------+
   | a | name |
   +---+------+
   | 0 | NULL |
   +---+------+
   1 row in set (0.01 sec)
   
   mysql> select avg(distinct id) as a,name from test;
   +---+------+
   | a | name |
   +---+------+
   | NULL | NULL |
   +---+------+
   1 row in set (0.01 sec)
   
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org