Oracle Sql Case When Multiple Conditions In For Loop