I am trying to select a row with a distinct id, yet return all the fields.
SELECT * DISTINCT(ID) FROM table WHERE ...
I ultimately need the ID, City, State and Zip. How can I get rows that are not duplicate ID's and return all fields into my mysql_fetch_array?
I have tried the following:
SELECT * DISTINCT(ID) FROM table WHERE ...
SELECT DISTINCT ID * FROM table WHERE ...
SELECT ID,City,State,Zip DISTINCT ID FROM ...
SELECT ID,City,State,Zip DISTINCT(ID) FROM ...
I was reading other questions here and none seem to help. Thanks in advance!
DISTINCT
will simply return unique IDs from the table; what are you trying to do exactly?ID
having different addresses... which address would you then want? random?