結果 : aggregate function with case statement in sql