I need to perform an SQL query to create a table which lists Quizzes with the same name. This is the query code I have so far:
$sql = "SELECT a.name, a.id FROM tests a
INNER JOIN tests b
ON a.tests = b.tests WHERE a.id <> b.id";
$result = mysql_query($sql, $conn);
However I’m not getting any results – I’ve made sure to manually check the database and there are definitely duplicates. Any ideas?
I think the simpliest way is to grouped then and filter it using
HAVING