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

  • <tfoot id='Oxr95'></tfoot>
    1. <legend id='Oxr95'><style id='Oxr95'><dir id='Oxr95'><q id='Oxr95'></q></dir></style></legend>

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

      1. 获取 MySQL 中现有行的插入语句

        Get Insert Statement for existing row in MySQL(获取 MySQL 中现有行的插入语句)

            1. <tfoot id='y2TMY'></tfoot>

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

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

                <bdo id='y2TMY'></bdo><ul id='y2TMY'></ul>
                  <tbody id='y2TMY'></tbody>
              • <legend id='y2TMY'><style id='y2TMY'><dir id='y2TMY'><q id='y2TMY'></q></dir></style></legend>

                  本文介绍了获取 MySQL 中现有行的插入语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  使用 MySQL 我可以运行查询:

                  Using MySQL I can run the query:

                  SHOW CREATE TABLE MyTable;
                  

                  它会返回指定表的创建表语句.如果您已经创建了一个表,并且想要在另一个数据库上创建相同的表,这将非常有用.

                  And it will return the create table statement for the specificed table. This is useful if you have a table already created, and want to create the same table on another database.

                  是否可以为已经存在的行或一组行获取插入语句?有些表有很多列,如果我能够得到一个插入语句来将行传输到另一个数据库而不必写出插入语句,或者不必将数据导出到 CSV 然后导入相同的数据,那对我来说会很好进入另一个数据库.

                  Is it possible to get the insert statement for an already existing row, or set of rows? Some tables have many columns, and it would be nice for me to be able to get an insert statement to transfer rows over to another database without having to write out the insert statement, or without exporting the data to CSV and then importing the same data into the other database.

                  只是澄清一下,我想要的是如下工作方式:

                  Just to clarify, what I want is something that would work as follows:

                  SHOW INSERT Select * FROM MyTable WHERE ID = 10;
                  

                  并为我返回以下内容:

                  INSERT INTO MyTable(ID,Col1,Col2,Col3) VALUES (10,'hello world','some value','2010-10-20');
                  

                  推荐答案

                  似乎没有办法从 MySQL 控制台获取 INSERT 语句,但您可以使用 mysqldump 就像 Rob 建议的那样.指定 -t 以省略表创建.

                  There doesn't seem to be a way to get the INSERT statements from the MySQL console, but you can get them using mysqldump like Rob suggested. Specify -t to omit table creation.

                  mysqldump -t -u MyUserName -pMyPassword MyDatabase MyTable --where="ID = 10"
                  

                  这篇关于获取 MySQL 中现有行的插入语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 秒)
                  MySQL cumulative sum grouped by date(按日期分组的 MySQL 累计总和)
                  • <bdo id='F071L'></bdo><ul id='F071L'></ul>

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

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

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