At university, my professor taught me this year that this SQL statement:
SELECT COUNT(length) FROM product
2 with the following dataset:
| product | |id | length | code | |-------------------| | 1 | 11 | X00 | | 2 | 11 | C02 | | 3 | 40 | A31 |
She justified it by saying that
COUNT doesn't count duplicates.
I told my professor that I thought she made an error. She answered me that some DBMS may or may not count duplicates.
After trying a lot of DBMS, I've never found one that has this behaviour.
Does this DBMS exist?
Is there any reason for a professor to teach this behaviour? And without even mentioning that other DBMS may behave differently?
FYI, the course support is available here (in french). The concerned slide is in the lower left corner at page 10.