結果 : sql group by case statement with aggregate function