結果 : case statement with aggregate function in sql