View Single Post
Old 03-08-2008, 01:18 PM   #2 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

Are you fetching the list from a database? If so, there are a couple of options you can use.

The first is to use the DISTINCT keyword in your query:

SQL Code:
SELECT DISTINCT fruit FROM products

The second is to use the GROUP BY clause in your query:

SQL Code:
SELECT fruit FROM products GROUP BY fruit

Both will give you the desired result

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote