• <i id='nlBTe'><tr id='nlBTe'><dt id='nlBTe'><q id='nlBTe'><span id='nlBTe'><b id='nlBTe'><form id='nlBTe'><ins id='nlBTe'></ins><ul id='nlBTe'></ul><sub id='nlBTe'></sub></form><legend id='nlBTe'></legend><bdo id='nlBTe'><pre id='nlBTe'><center id='nlBTe'></center></pre></bdo></b><th id='nlBTe'></th></span></q></dt></tr></i><div id='nlBTe'><tfoot id='nlBTe'></tfoot><dl id='nlBTe'><fieldset id='nlBTe'></fieldset></dl></div>

  • <tfoot id='nlBTe'></tfoot><legend id='nlBTe'><style id='nlBTe'><dir id='nlBTe'><q id='nlBTe'></q></dir></style></legend>

    <small id='nlBTe'></small><noframes id='nlBTe'>

        <bdo id='nlBTe'></bdo><ul id='nlBTe'></ul>

      1. mysql 使用另一个表中的值更新列

        时间:2023-08-18

                <small id='VLIYu'></small><noframes id='VLIYu'>

              1. <i id='VLIYu'><tr id='VLIYu'><dt id='VLIYu'><q id='VLIYu'><span id='VLIYu'><b id='VLIYu'><form id='VLIYu'><ins id='VLIYu'></ins><ul id='VLIYu'></ul><sub id='VLIYu'></sub></form><legend id='VLIYu'></legend><bdo id='VLIYu'><pre id='VLIYu'><center id='VLIYu'></center></pre></bdo></b><th id='VLIYu'></th></span></q></dt></tr></i><div id='VLIYu'><tfoot id='VLIYu'></tfoot><dl id='VLIYu'><fieldset id='VLIYu'></fieldset></dl></div>
                <legend id='VLIYu'><style id='VLIYu'><dir id='VLIYu'><q id='VLIYu'></q></dir></style></legend>

                  <bdo id='VLIYu'></bdo><ul id='VLIYu'></ul>
                  <tfoot id='VLIYu'></tfoot>
                    <tbody id='VLIYu'></tbody>
                  本文介绍了mysql 使用另一个表中的值更新列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有两张桌子,看起来都像

                  I have two tables, both looking like

                  id  name  value
                  ===================
                  1   Joe     22
                  2   Derk    30
                  

                  我需要根据每个表中的检查名称将value的值从tableA复制到tableB.

                  I need to copy the value of value from tableA to tableB based on check name in each table.

                  对于这个 UPDATE 语句有什么提示吗?

                  Any tips for this UPDATE statement?

                  推荐答案

                  除了这个答案,如果您需要根据 tableA.value 动态更改 tableB.value,您可以这样做,例如:

                  In addition to this answer if you need to change tableB.value according to tableA.value dynamically you can do for example:

                  UPDATE tableB
                  INNER JOIN tableA ON tableB.name = tableA.name
                  SET tableB.value = IF(tableA.value > 0, tableA.value, tableB.value)
                  WHERE tableA.name = 'Joe'
                  

                  这篇关于mysql 使用另一个表中的值更新列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在 MySql 中进行重音敏感搜索 下一篇:导入大型 sql 文件时 MySQL 服务器已消失

                  相关文章

                  最新文章

                  1. <small id='DUeKH'></small><noframes id='DUeKH'>

                  2. <legend id='DUeKH'><style id='DUeKH'><dir id='DUeKH'><q id='DUeKH'></q></dir></style></legend>
                      <tfoot id='DUeKH'></tfoot>
                      <i id='DUeKH'><tr id='DUeKH'><dt id='DUeKH'><q id='DUeKH'><span id='DUeKH'><b id='DUeKH'><form id='DUeKH'><ins id='DUeKH'></ins><ul id='DUeKH'></ul><sub id='DUeKH'></sub></form><legend id='DUeKH'></legend><bdo id='DUeKH'><pre id='DUeKH'><center id='DUeKH'></center></pre></bdo></b><th id='DUeKH'></th></span></q></dt></tr></i><div id='DUeKH'><tfoot id='DUeKH'></tfoot><dl id='DUeKH'><fieldset id='DUeKH'></fieldset></dl></div>

                      • <bdo id='DUeKH'></bdo><ul id='DUeKH'></ul>