結果 : sql case statement with aggregate function