結果 : nested case when postgresql