• <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查询时如何获取受影响的行数?

        How to get number of rows affected, while executing MySQL query from bash?(从bash执行MySQL查询时如何获取受影响的行数?)

        <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查询时如何获取受影响的行数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                  MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)
                  <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>
                    <tbody id='aEWZo'></tbody>
                    • <bdo id='aEWZo'></bdo><ul id='aEWZo'></ul>

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