Could you please Explain this strange behavior of count (distinct client_id) statement.
for :
SELECT count(distinct client_id)
from clients_data where bank_name ='SABB' and tstatus = 0
I have got 6000 rows
and for
SELECT count(distinct client_id)
from clients_data where bank_name ='SABB' and tstatus = 0 and cif_type = 'CARD'
I have got 5964
and for
SELECT count(distinct client_id)
from clients_data where bank_name ='SABB' and tstatus = 0 and cif_type = 'LOAN'
I have got 42 rows .
but
5964 + 42 = 6006
and the first query gets only 6000 .
where these extra 6 rows come from ?
Note : Data now is not Available for any suggestions .
the image is here :
There could be six
client_idthat have both a CARD and a LOAN.