79138676

Date: 2024-10-29 19:31:55
Score: 0.5
Natty:
Report link

The answer here, pulled from the comments, was to drop the existing table and replace it with one that is more properly normalized. The structure of the new table will be something akin to the following:

ItemGroup CountryCode Rate
100 CN 2.7
100 GB 1.6
101 CN 1.7
101 GB 0.5

Likely foreign keys: ItemGroup, CountryCode Likely unique index: ItemGroup + CountryCode

This table structure allows a selection by either ItemGroup or by Country to get the desired Rate or rates. A join to a country detail table can provide the additional information if required and a join to an Item table can provide information about the item.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: ClearlyClueless