Select ID, CNPJ, Sum(1) As Ocorrencias From Clientes; Group by ID Having Ocorrencias>1 Into Cursor Resultado