Sql Case When Nested Dictionary