結果 : nested case statement postgresql