I have a table that looks like this:
Pizza ----|| Topping
====================
Cheese--|| Olives
====================
Ham----- || Tuna
====================
Cheese-- || Olives
====================
Cheese-- || Tuna
====================
I would like to obtain the number of pizzas of each type, so in the table above there would be one ham pizza, and 2 cheese pizzas (since cheese+olives is repeated and should be counted only once). Basically, I need to count each row for each two equal elements and group by pizza.
The result from that query should be:
Pizza ----|| Count
====================
Cheese--|| 2
====================
Ham----- || 1
====================
Thanks!
1 Answer