Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display list of field entries but remove duplicates

Status
Not open for further replies.

LEICJDN1

Technical User
Nov 27, 2002
201
GB
Hi,

Am planning Access / ASP pages to allow me to index references, and search by field. The database contains fields for 'category','subject','keywords', and then 'location'. What I hope to do is provide a list of all the categories, or keywords, depending on what is chosen (as well as search facilities and index listing).

So, I know how to connect to the database, and pull recordsets, but what is the easiest way to retrieve all the entries present in one field, remove duplicates so each entry (e.g. category) is only displayed once, then sort alphabetically? Cannot 'fix' categories as may change as more are added.

Not asking for code as I have not started writing the pages yet but am trying to build up the principles in my head first!

Cheers.
 
select DISTINCT (cat) from tableName

The DISTINCT keyword will remove duplicated from the resultset


Bastien

Cat, the other other white meat
 
Thanks Bastien, I knew there would be an easy answer I was not aware of.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top