I've got a small query going that looks basically like this:
SELECT * from `mydb` WHERE `IDENTIFIER` = $variable
The $variable contains a value the user chooses from a coded dropdown.
The database I am working with contains multi-thousands of entries - BUT - there are many duplicate entries where ONLY one field (EMAIL) is different from the rest:
EMAIL ADDRESS COMPANY NAME STREET IDENTIFIER
joe@acme.com 23 Elm Street Acme Investing San Diego 12345
john@blarney.com 90 Oak Street Blarney Capital Berkeley 12345
fred@blarney.com 90 Oak Street Blarney Capital Berkeley 12345
mary@blarney.com 90 Oak Street Blarney Capital Berkeley 12345
I want to select all records, where `IDENTIFIER` = '12345', AND
which have a unique address. The problem is that the database has many listings at a single addresses, and I only want one record per address.
I think I could write this if I could figure out the logic!
TIA for your usual expertise!