gpt4 book ai didi

MYSQL查询比较和更新表

转载 作者:行者123 更新时间:2023-11-30 00:53:12 25 4
gpt4 key购买 nike

请帮助使用 mysql 创建查询。
我有两张 table :
表_E 和表-I。

enter image description here

描述我的查询:

Select table_E.obj_id and find obj_id in table_I.
learn table_I.field_id, where the same varchar_val tables .
If table_I.field = 483 , upgrade table_I.float_val ( where table_I.field = 268) , the value table_E.float_val
If table_I.field = 484 , upgrade table_I.float_val ( where table_I.field = 467 ) , the value table_E.float_val
...
If table_I.field = 499 , upgrade table_I.float_val ( where table_I.field = 482) , the value table_E.float_val

和第二个数据库,例如:

Select table_E.obj_id and find obj_id in table_I.
learn table_I.field_id, where the same varchar_val tables .
If table_I.field = 483 , upgrade table_I.varchar_val ( where table_I.field = 446 ) , the value table_E.old_p
If table_I.field = 484 , upgrade table_I.varchar_val ( where table_I.field = 515 ) , the value table_E.old_p
...
If table_I.field = 499 , upgrade table_I.varchar_val ( where table_I.field = 271 ) , the value table_E.old_p

最佳答案

MySQL Utilities有一个名为 mysqldiff 的工具:http://dev.mysql.com/doc/mysql-utilities/1.4/en/mysqldiff.html

This utility reads the definitions of objects and compares them using a diff-like method to determine whether they are the same. The utility displays the differences for objects that are not the same.

...

By default, the utility generates object differences as a difference report. However, you can generate a transformation report containing SQL statements for transforming the objects for conformity instead.

您可以从上面的下载链接获取这些实用程序,或者将其作为 MySQL Workbench 的一部分。

关于MYSQL查询比较和更新表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20799364/

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