Forum Moderators: open

Message Too Old, No Replies

Select only 1 of each type of record

dont list duplications

         

Angelis

9:13 am on Nov 15, 2005 (gmt 0)

10+ Year Member



Hi everyone

I need to grab some titles out of a database but only list the unique entrys.

e.g.

If I have a table with 5 rows in it and have the following titles.

a. cabbage
b. lemon
c. lemon
d. apple
e. sardines

I need to be able to output individual rows without duplicates so as a result I would only receive 4 results back e.g.

cabbage, lemon, apple, sardines

I have looked through the mysql website and I cant find any information about how to do it, any help appreciated...

topr8

9:21 am on Nov 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



SELECT DISTINCT fruitName from table

Angelis

9:24 am on Nov 15, 2005 (gmt 0)

10+ Year Member



Easy as that :S

Im ashamed, thanks for the info...

coopster

2:19 pm on Nov 15, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You don't need to be ashamed, that is what forums are for -- getting answers and having discussion! We all had to learn the answer to that question at one point in our growth too you know ;)