Maybe you could use the COUNT() function with the SELECT ... HAVING option.