I have a query as follows, and would like to filter by COUNT
SELECT COUNT(1) AS QTD,
Nome,
Cpf
FROM Funcionarios
WHERE QTD >= 2
GORUP BY Nome, Cpf
I have a query as follows, and would like to filter by COUNT
SELECT COUNT(1) AS QTD,
Nome,
Cpf
FROM Funcionarios
WHERE QTD >= 2
GORUP BY Nome, Cpf
Try adjusting your query to filter after grouping the data with Having clause:
SELECT COUNT(1) AS QTD,
Nome,
Cpf
FROM Funcionarios
GROUP BY Nome, Cpf
HAVING COUNT(1) >= 2