The error of your query is related to the fact that the subquery is returning more than one column. For, the main query filter is just waiting for a set of cpfs.
Don’t make the mistake you should do the following:
SELECT CPF FROM ZPCF
WHERE CPF IN (SELECT CPF FROM ZCPF WHERE
GROUP BY CPF HAVING COUNT() > 1)
However, by the description of what you expect I imagined that the correct query would be the following:
SELECT DISTINCT CPF,TELEFONE FROM ZPCF
This query will return all phones related to a particular Cpf without duplicities.
EX:
GGG 11111
AAA 2222
GGG 11111
AAA 333333
The query return would be as follows:
GGG 11111
AAA 2222
AAA 333333
Here
... WHERE CPF IN (SELECT TELEFONE, COUNT() ...
there is no fieldCPF´ na lista de campos do subselect. Creio que seu subselect deva retornar apenas uma lista de CPFs. Estude a cláusula
IN`.– anonimo
which database you are using and which version?
– imex