I need to query my database to show the records inside my table where lastname occurs more than three times. Example: in my Students Table, there are 3 people with Lastname
For MySQL:
SELECT lastname AS ln FROM (SELECT lastname, count(*) as Counter FROM `students` GROUP BY `lastname`) AS tbl WHERE Counter > 2