uchenily commented on issue #57707:
URL: https://github.com/apache/doris/issues/57707#issuecomment-3624475553
The result `COUNT(DISTINCT col1, col2)` return 2 is expected, same with
mysql (tested on MariaDB 10.11.13)
```sql
MariaDB [test]> CREATE TABLE test_distinct (
-> col1 VARCHAR(10),
-> col2 VARCHAR(10)
-> );
Query OK, 0 rows affected (0.026 sec)
MariaDB [test]> INSERT INTO test_distinct VALUES
-> ('A', 'X'),
-> ('A', 'X'),
-> ('B', NULL),
-> ('B', NULL),
-> ('C', 'Y'),
-> (NULL, 'Z'),
-> (NULL, NULL);
Query OK, 7 rows affected (0.003 sec)
Records: 7 Duplicates: 0 Warnings: 0
MariaDB [test]> SELECT DISTINCT col1, col2 FROM test_distinct;
+------+------+
| col1 | col2 |
+------+------+
| A | X |
| B | NULL |
| C | Y |
| NULL | Z |
| NULL | NULL |
+------+------+
5 rows in set (0.000 sec)
MariaDB [test]> SELECT COUNT(DISTINCT col1, col2) FROM test_distinct;
+----------------------------+
| COUNT(DISTINCT col1, col2) |
+----------------------------+
| 2 |
+----------------------------+
1 row in set (0.001 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]