I am trying to output any duplicate records in a table and using the following query:
SELECT
ID,
First_Name,
Last_Name,
Address,
Address2,
Address3,
Postcode,
COUNT(*) AS c
FROM resident_permit
GROUP BY Address
HAVING c > 1
ORDER BY Address;
This works perfectly when I try running it against the database but phprunner keeps throwing up an error: ORDER BY fiels must match SELECT fields - I have selected autofix and skip but as soon as I try to run the applications I get a php error 256 "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; as Address;
FROM resident_permit
GROUP BY Address
having ((c > 1)' at line 2"
If anyone can help they will have my eternal gratitude?