我需要存储20个国家(最初)的30个类别物品的总计,并且还能够轻松更新和检索它们。什么是这样做的好方法?存储20个国家30个类别的物品总数
我目前的方法是使用类别作为列名。
"genId" "country" "alcohol_spirits" "music" /* other categories go here */
"1" "US" "0" "0"
"2" "UK" "0" "0"
"3" "SE" "0" "0"
/* other countries go here */
或
使用国家代码作为列名
"genId" "category" "US" "UK" /* other countries go here */
"1" "music" "0" "0"
"2" "movies" "0" "0"
"3" "food&Beverage" "0" "0"
/* other categories go here */
没有那些有什么东西好,说我的两个方法。
你能提出一个更好的方法来做到这一点吗?
可能重复(HTTP:/ /stackoverflow.com/questions/23807781/update-a-table-with-count-from-another-table) – Strawberry
@Strawberry这是如何重复? – Norman
您已经正确认识到您的模式需要重新设计。考虑到这一点,要求SO社区继续考虑与不再相关的模式相关的问题是不恰当的。你应该关闭这个问题。或修改它并关闭这个。 – Strawberry