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

    <tfoot id='ybstm'></tfoot>
  • <small id='ybstm'></small><noframes id='ybstm'>

      1. 从bash执行MySQL查询时如何获取受影响的行数?

        时间:2023-06-01

        <legend id='Yv6MV'><style id='Yv6MV'><dir id='Yv6MV'><q id='Yv6MV'></q></dir></style></legend>
        1. <small id='Yv6MV'></small><noframes id='Yv6MV'>

        2. <tfoot id='Yv6MV'></tfoot>

            • <i id='Yv6MV'><tr id='Yv6MV'><dt id='Yv6MV'><q id='Yv6MV'><span id='Yv6MV'><b id='Yv6MV'><form id='Yv6MV'><ins id='Yv6MV'></ins><ul id='Yv6MV'></ul><sub id='Yv6MV'></sub></form><legend id='Yv6MV'></legend><bdo id='Yv6MV'><pre id='Yv6MV'><center id='Yv6MV'></center></pre></bdo></b><th id='Yv6MV'></th></span></q></dt></tr></i><div id='Yv6MV'><tfoot id='Yv6MV'></tfoot><dl id='Yv6MV'><fieldset id='Yv6MV'></fieldset></dl></div>
                  <tbody id='Yv6MV'></tbody>
                  <bdo id='Yv6MV'></bdo><ul id='Yv6MV'></ul>
                • 本文介绍了从bash执行MySQL查询时如何获取受影响的行数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我知道如何从 bash 执行 MySQL 查询/命令:

                  I know how one can execute MySQL queries / commands from bash:

                  mysql -u[user] -p[pass] -e "[mysql commands]"
                  

                  mysql -u[user] -p[pass] `<<`QUERY_INPUT
                  
                  [mysql commands]
                  
                  QUERY_INPUT
                  

                  如何捕获受查询影响的行数?
                  我试着做:

                  How can I capture how many rows were affected by the query?
                  I tried doing:

                  variable='`mysql -u[user] -p[pass] -e "[mysql commands]"`'
                  

                  它确实执行了命令,但不返回受影响的行数.

                  It does execute the command but it does not return the number of affected rows.

                  推荐答案

                  Put

                  SELECT ROW_COUNT();
                  

                  作为批处理中的最后一条语句并解析输出

                  as the last statement in your batch and parse the output

                  这篇关于从bash执行MySQL查询时如何获取受影响的行数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:具有唯一字段的 MySQL 数据库忽略结尾空格 下一篇:带下划线的 MySQL LIKE 查询

                  相关文章

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

                  <legend id='aEWZo'><style id='aEWZo'><dir id='aEWZo'><q id='aEWZo'></q></dir></style></legend><tfoot id='aEWZo'></tfoot>
                  • <bdo id='aEWZo'></bdo><ul id='aEWZo'></ul>

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