How does SQL statistics remove duplicate data records? If the records are duplicated and not counted, it is counted as 0, and only the records that are not duplicated are counted.

  mysql, question

For example, I want to count the number of records in the database. If I want to repeat a field, the count will be 0. For example, a database that stores invoices for selling cars has a Vehicle identification number field called CJHM. I want to count the number of cars sold that month, but I want to get rid of the same record of CJHM. That is, if the CJHM of two records are the same, then neither record is counted. For example, the following table:
ID CJHM XSSJ
1 ljh908 2018-06-07
2 ljh908 2018-06-07
3 33ert78 2018-06-10
4 9087jh1 2018-06-23

The statistical results are required to be shown as: 2, that is, the same two records of CJHM are removed

SELECT COUNT(1)
 FROM (
 SELECT 1
 FROM `car`
 GROUP BY `CJHM`
 HAVING COUNT(1)=1
 ) a;