http://qs321.pair.com?node_id=664271


in reply to (OT) Exclusion selection on DBI

Untested:
SELECT name, color, count(name) as c FROM fruit GROUP BY name HAVING c + >= 2 ORDER BY fruit;

I don't know if that's standard sql, but it should work with MySQL

Update: I just tested something similar with mysql 5, and the alias doesn't seem to be necessary, so just SELECT name, color FROM fruit GROUP BY name HAVING COUNT(name) >= 2 ORDER BY fruit;