SELECT id_company, COUNT(id_company) AS occurrences FROM company GROUP BY id_company HAVING ( COUNT(
id_company
) > 1 )
You could also use this technique to find rows that occur exactly once as bellow
SELECT id_company
FROM company
GROUP BY id_company
HAVING ( COUNT(id_company) = 1 )
No comments:
Post a Comment