MySQL Forums
Forum List  »  Newbie

query to return unique items
Posted by: Barrette Plett
Date: July 12, 2005 11:25AM

Hello,
I'm just learning SQL. I think this might be a very easy question, but I can't find out how to do it:
I'd like to do a query that would just return a list of unique items from a table. Here's an example.

The table might contain
FIELDS: id, name, comment
DATA:
1, Bob, Hi there
2, Bob, Goodbye
3, Norm, Howdy
4, Norm, See ya
5, Norm, Later
6, Annie, Greetings

What I'd like is a SELECT statement to return:
Bob
Norm
Annie

I know how to do this in PHP or on my client, but it seems to me that this would be better done on the server to reduce data volume.
Could someone either post a sample query or a hint or a link to a place where I could look it up?

Thanks!

Barrette

Options: ReplyQuote


Subject
Written By
Posted
query to return unique items
July 12, 2005 11:25AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.