Page 1 of 1

Unique select

Posted: Wed Jul 27, 2005 4:33 am
by someberry
I know this is possible; I remember seeing it, but can't remember where.

I would like to search a database, but only return 1 of each unique value. For instace, if the database looks like this:

1 cat
2 dog
3 dog
4 dog
5 cat
6 foo

How could I get the SELECT statement to only return:

1 cat
2 dog
3 foo

Thank you,
Someberry.

Posted: Wed Jul 27, 2005 5:31 am
by anjanesh

Posted: Wed Jul 27, 2005 7:02 am
by dreamline
Translated that would be:
select distinct <name of field> from <database> [where clause]

:D