Quote:
Originally Posted by ben
Let's assume we want to find duplicate emails in a 'users' table:
[sql]
SELECT id, email, count(email) FROM users GROUP BY email HAVING count(email) > 1
[/sql]
|
That doesn't work in PostgreSQL:
ERROR: column "users.id" must appear in the GROUP BY clause or be used in an aggregate function