5
I have a chart with 3 million phones, and I have the code for each customer. My goal is to find which phone repeats on different customers.
For that, I can count how many times he repeats, but I can’t know to whom he repeats.
Follow an example of the code.
SELECT      PARCEIRO
        ,   TELEFONE
        ,   COUNT(TELEFONE) AS QTD
FROM        tabela
GROUP BY    TELEFONE
        ,   PARCEIRO
HAVING      COUNT(*)>1
ORDER BY    COUNT(PARCEIRO)
FROM tabela;that;closes before grouping.. that’s not the problem?– rLinhares
Ah disregard ;, typo hehe.
– Gilson Andrade
However if I turn the code, it gives me the right amount , however legal I have the amount of repetitions but what I want and know to whom it repeats.
– Gilson Andrade
I corrected the accent, and I removed all the tags. If it is not Mysql, put ONLY the tag of your database, because it is a specific case, and not general.
– rbz