作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个这样的表格:
选项 1 - 值 1(数字)
选项 2 - 值 2(数字)
……
选项 459 - 值 459(数字)
“添加新选项”
正如你所看到的,我不知道会有多少个选项。我只知道如果通过 url 访问一个选项,我需要在每次访问时在某处加上 + 1。
我的 table 应该是什么样子......?
最佳答案
您可能想要一个“长而窄”的 table :
CREATE TABLE OptionValue (
id INT --this is a surrogate primary key. Optional, but I like to have them.
,optionGroup INT --since you have more then one set of options stored here
,optionNo INT,
,Value numeric
)
或者类似的东西。
关于mysql - 为未知数量的字段创建一张表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23208886/
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: Combination of List> 我有多个列表,可以是 2 个或 3 个,最多 10 个列表,有多个
我是一名优秀的程序员,十分优秀!