I need a query that returns only `the rows in my user database where the first name and last name appear more than once. I am trying to weed out some duplicates. A number people kept pressing submit and added themselves a few times before I put a block in the routine.
I tried this query:
SELECT regLastName, count(regLastName)
FROM ra_registrant
GROUP BY regLastName
ORDER BY regLastName
and get a predictable return...
+------------------+--------------------+
| regLastName | count(regLastName) |
+------------------+--------------------+
| Aakre | 1 |
| Aaron | 2 |
| Abdul - Aleem | 1 |
| Abdulla | 2 |
| Abnet | 1 |
| Acawpora | 1 |
| Achilles | 5 |
.
.
.
+------------------+--------------------+
But how can I tell only return the rows where the count > 1?
Zach
I tried this query:
SELECT regLastName, count(regLastName)
FROM ra_registrant
GROUP BY regLastName
ORDER BY regLastName
and get a predictable return...
+------------------+--------------------+
| regLastName | count(regLastName) |
+------------------+--------------------+
| Aakre | 1 |
| Aaron | 2 |
| Abdul - Aleem | 1 |
| Abdulla | 2 |
| Abnet | 1 |
| Acawpora | 1 |
| Achilles | 5 |
.
.
.
+------------------+--------------------+
But how can I tell only return the rows where the count > 1?
Zach