I have two columns in my Items table ‘Category’, ‘Category2’, the two columns contain, essentially the same information. If I had designed the database I would have created a separate table for categories and added items to categories based based off of that table, unfortunately I didn’t create the database and I can’t change it now but I think there is still a way to do what I want to do.
An example of the table is shown below
Category Category2
------------------ -----------------
truck full size - pickup
full size - pickup truck
Sedan Import - Sedan
Convertible Domestic - Coupe
I want to run a query to count the total number of trucks, sedans, full size – pickup, etc. I tried the below query but it grouped the two columns separately
SELECT Category, Count(*) as Count
FROM Items
GROUP BY Category, Category2
Just dump both categories into a single column before grouping.