I'm hoping this is simple.
I have a list categories, A,B C. I want to get the count of the number of occurances each category appears in another table.
Result Wanted:
Category COUNT_OF_LINES
A 10
B 12
C 8
Psudeo SQL
SELECT CATEGORY
(SELECT COUNT_OF_LINES
FROM ORDERS_LIST) AS OL
WHERE OL.CATEGORY = A or B or C
Any help. Does it need a sub-query.
I suspect I will have to read the categories from a table soon. Same result needed but:
Psudeo SQL
SELECT CATEGORY FROM CATEGORY_TABLE DISTINCT
(SELECT COUNT_OF_LINES
FROM ORDERS_LIST) AS OL
WHERE OL.CATEGORY = CATEGORY
Yep, I'm new at this.
I have a list categories, A,B C. I want to get the count of the number of occurances each category appears in another table.
Result Wanted:
Category COUNT_OF_LINES
A 10
B 12
C 8
Psudeo SQL
SELECT CATEGORY
(SELECT COUNT_OF_LINES
FROM ORDERS_LIST) AS OL
WHERE OL.CATEGORY = A or B or C
Any help. Does it need a sub-query.
I suspect I will have to read the categories from a table soon. Same result needed but:
Psudeo SQL
SELECT CATEGORY FROM CATEGORY_TABLE DISTINCT
(SELECT COUNT_OF_LINES
FROM ORDERS_LIST) AS OL
WHERE OL.CATEGORY = CATEGORY
Yep, I'm new at this.