Thanks for the response, but I think I didn't explained myself clearly enough.
Let me try another example:
Say I have a table that hold three columns: user_id, email, and zip_code. The column user_id is the primary key and is thus auto incremented.
Also assume that I have several rows in the table where email and zip code are identical.
Now, say I want to run a query where email and zip code are distinct. This could be done easily enough with SELECT DISTINCT email, zip code FROM tablename
But say I also want to find the user_id of those distinct rows. If I say SELECT DISTINCT * from tablename, it will return several rows that have the same email and zip code because including user_id ensures that each row will always be distinct.
So what I want to do is SELECT DISTINCT email, zip code FROM tablename, and then somehow find the user_id for only those returned rows.
I hope that makes sense.
Thanks.