[sql]SELECT emp, COUNT(emp) AS NumOccurrences
FROM users GROUP BY emp
HAVING ( COUNT(emp) > 1 )[/sql]
also, find only one record:
[sql]SELECT emp
FROM users GROUP BY emp
HAVING ( COUNT(emp) = 1 )[/sql]
[sql]SELECT emp, COUNT(emp) AS NumOccurrences
FROM users GROUP BY emp
HAVING ( COUNT(emp) > 1 )[/sql]
also, find only one record:
[sql]SELECT emp
FROM users GROUP BY emp
HAVING ( COUNT(emp) = 1 )[/sql]
Not sure if count() can only be set on multiple fields in a single select. Maybe try and use a Union (Select U Select) and set the count in both ?
How do I run an Update statement against these results, where I set a field other than emp on all records that have a count higher than 1?