Click to See Complete Forum and Search --> : Displaying unique data


scouse
01-13-2005, 10:53 AM
Hi,

I've got a table with a field called "CATEGORY" with various information in it:-

--------
CATEGORY|
--------
VIDEO
TV
COMPUTER
TV
TV
VIDEO
MISC
---------

I want to display all the data on a page, but if any two categories are the same I don't want the page to display repeats.

For example if I just pulled all the data from the table and listed it on a page it would be:

VIDEO
TV
COMPUTER
TV
TV
VIDEO
MISC


Whereas I don't want repeated categories and instead want it to be listed on the page like this:

VIDEO
TV
COMPUTER
MISC

Does anyone know how I could do this?

Hope that makes sense, I was having trouble trying to explain what I meant. :rolleyes:

Thanks in advance

Phil

russell
01-13-2005, 01:57 PM
do you mean a database table?

SELECT Distinct Category FROM myTable

scouse
01-14-2005, 06:30 AM
Hi Russell,

Thanks very much. Thats exactly what I was after.

Cheers

Phil