結果 : nested case when postgres