gpt4 book ai didi

mysql - 为未知数量的字段创建一张表

转载 作者:行者123 更新时间:2023-11-30 00:21:22 24 4
gpt4 key购买 nike

我有一个这样的表格:

选项 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com