Remova esses parênteses ao redor das colunas para o
group by
:Select *, CASE WHEN age>18 then 'Adult' ELSE 'MINOR' end as category
from student
order by category, name;
Exemplo on-line:https://rextester.com/BHQ36816
group by
:Select *, CASE WHEN age>18 then 'Adult' ELSE 'MINOR' end as category
from student
order by category, name;