Bug #21027 | COUNT(DISTINCT a, b) inconsistent with COUNT(*) FROM (SELECT DISTINCT a, b) | ||
---|---|---|---|
Submitted: | 13 Jul 2006 7:47 | Modified: | 13 Jul 2006 12:13 |
Reporter: | Mattias Jiderhamn | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.22 | OS: | Windows (Windows) |
Assigned to: | CPU Architecture: | Any |
[13 Jul 2006 7:47]
Mattias Jiderhamn
[13 Jul 2006 12:13]
Valeriy Kravchuk
Thank you for a problem report. Sorry, but as explained in that bug #3199: "Manual defines our nonstandard extension COUNT(DISTINCT a,b,c,...) as being equivalent to standard COUNT(DISTINCT CONCAT(a,b,c,...)) COUNT(a,b,...,NULL) is NULL and COUNT(DISTINCT expr) ignores NULLs, as it should." SELECT COUNT(*) FROM anything;, to the contrary, returns number of rows in that table or row source. So, as SELECT DISTINCT a,b returns 3 rows, the result 3 is correct as well.