Here we duplicate CASE operator in SELECT clause to receive a column with the name of operational system.
You can do the grouping by different number of columns using CASE operator within a single query. Let's consider the following task for example.
For each unique pair of values of processor's speed and hd capacity, determine average PC price. For the products with speed lower than $600, do grouping by a speed only.
For comparison, first let's obtain grouping by one column (speed) and by two columns (speed, hd) respectively.
Console
Execute
SELECT speed,MAX(hd) max_hd, AVG(price) avg_price FROM pc