Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MySQL例程编程、多表和字符串操作_Mysql_Procedure - Fatal编程技术网

MySQL例程编程、多表和字符串操作

MySQL例程编程、多表和字符串操作,mysql,procedure,Mysql,Procedure,好吧,我遇到了一个问题。。这很难解释,但我会尽力做到最好 我有一个包含两个表的数据库: 1类表 classname | points | max | min _____________________________________________________ Land | tree,bush,house | 1 | 0.2 Sea | fish,water | 1 |

好吧,我遇到了一个问题。。这很难解释,但我会尽力做到最好

我有一个包含两个表的数据库:

1类表

classname | points                     | max | min
_____________________________________________________
Land      | tree,bush,house            | 1   | 0.2
Sea       | fish,water                 | 1   | 0.3
Air       | bird,plane,moon,sun,clouds | 1   | 0.5
2数据表:

ID | classname | points
___________________________
5  | Land      |
6  | Land      |
9  | Land      |
11 | Sea       |
15 | Sea       |
20 | Air       |
1  | Land      |
ID | classname | points
_________________________________________________________
5  | Land      | [["tree",A],["bush",B],["house",C]]
6  | Land      | [["tree",D],["bush",E],["house",F]]
9  | Land      | [["tree",G],["bush",H],["house",I]]
11 | Sea       | [["fish",F],["water",G]]
15 | Sea       | [["fish",H],["water",I]]
20 | Air       | [["bird",J],["plane",K],["moon",L],["sun",M],["clouds",N]]
1  | Land      | [["tree",O],["bush",P],["house",Q]]
类表中包含数据表的所有可能类名 如果“点”列中有点为空的行,则应按以下结果所示对其进行编辑


现在,结果应该是:

数据表:

ID | classname | points
___________________________
5  | Land      |
6  | Land      |
9  | Land      |
11 | Sea       |
15 | Sea       |
20 | Air       |
1  | Land      |
ID | classname | points
_________________________________________________________
5  | Land      | [["tree",A],["bush",B],["house",C]]
6  | Land      | [["tree",D],["bush",E],["house",F]]
9  | Land      | [["tree",G],["bush",H],["house",I]]
11 | Sea       | [["fish",F],["water",G]]
15 | Sea       | [["fish",H],["water",I]]
20 | Air       | [["bird",J],["plane",K],["moon",L],["sun",M],["clouds",N]]
1  | Land      | [["tree",O],["bush",P],["house",Q]]
点列中A-Q的字母应该是类表最小值和最大值之间的随机十进制数

classname | points                     | max | min
_____________________________________________________
Land      | tree,bush,house            | 1   | 0.2
Sea       | fish,water                 | 1   | 0.3
Air       | bird,plane,moon,sun,clouds | 1   | 0.5
如果有人能帮我解决这个问题,我将不胜感激,如果需要更多的信息,尽管问吧


我是一个初学者:我不太确定,但首先看一下表,我知道这段关系可能是错误的。
然而,这取决于你的需要。我无法理解整个问题,但尝试将classtable ID存储在datatable中。

老实说,当我看到数据分隔在一列中时,我停止了阅读。永远不要那样做。阅读有关数据库规范化的内容,更改数据库设计。更改表将是一件痛苦的事情。。。因为它们被其他程序使用。。。我的主要问题是,我需要一个过程,该过程将在数据表中相应地生成points列(生成的输入在类表中)