-- multiple columns SELECT COUNT(*) c , CONCAT(students.first_name, "----",students.last_name) FROM students WHERE students.class_id = classes.id GROUP BY CONCAT(first_name,"----",last_name) HAVING c > 1;