Can I use a SQL query to find records where one field is identical in both? That is, can I use the following table and return 1,3 (the ids) by comparing the name columns (and ignoring the phone)?
ID | Name | Phone 1 | Bob | 5555555555 2 | John | 1234567890 3 | Bob | 1515151515 4 | Tim | 5555555555
To get all names that exist more than once you can execute this statement:
SELECT Name FROM People GROUP BY Name HAVING COUNT(*)>1;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With