結果 : nested case when in postgresql