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
jumpstart0321Asked:
Who is Participating?
 
RWrigleyConnect With a Mentor Commented:
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.
0
 
QPRCommented:
group by category?
0
 
jumpstart0321Author Commented:
DISTINCT did it. Thanks :)
0
All Courses

From novice to tech pro — start learning today.