Question : Advanced Sql Select statement

I have a database of 1.6 million products, all of them pertaining to a certain "category" that wasn't even set forth by me. Is there a specific statement I can do to get all the categories only once? For example, the results to be:
computers
art
electronics
software
NOT:
computers
computers
art
computers
software
software

Answer : Advanced Sql Select statement

Use the "DISTINCT" clause on you select statement?

If you're database server is 2005, you could create an indexed view based on the category, and select form the view; this will not only give you just the distinct categories, but it'll also be much, much faster then scanning the 1.6million row table.
Random Solutions  
 
programming4us programming4us