結果 : using aggregate functions in case statement sql