PHP/MySQL, please help.?

So I have a query pulling subcategories from a table of museum exhibits. It looks something like:

SELECT subcategory FROM exhibits;

and returns the subcategory for all 200+ entries. The problem is that I need to generate a list of the different subcategories, and I'd rather not have a separate table of subcategories. That is, I need something like this:

SELECT subcategory FROM exhibits {BUT ONLY SHOW EACH SUBCATEGORY ONCE};

PHP string functions are a totally valid option... My first thought was to use strcompare(), but I can't quite reason out how to do it.

Rav2008-06-11T09:18:09Z

Favorite Answer

SELECT DISTINCT subcategory FROM exhibits