結果 : aggregate function in case statement sql