Reputation: 429
I have a table in my database where I store order information. Each order has OrderID, CategoryName, ProductName
. The CategoryName
is for knowing which category each product belongs to.
How would I write a SQL query that gets the categorynames
. I have duplicate categoryname
in the table, if there are duplicate categoryname
, then only one categoryname
of that type.
How does a SQL query for that look like?
Any help is very appreciated.
Upvotes: 0
Views: 1299
Reputation: 800
alternatively you can have this syntax as well
SELECT CategoryName
FROM YourTable
Group BY CategoryName
Upvotes: 0