<tfoot id='xraXS'></tfoot>

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

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

      <legend id='xraXS'><style id='xraXS'><dir id='xraXS'><q id='xraXS'></q></dir></style></legend>
        <bdo id='xraXS'></bdo><ul id='xraXS'></ul>
    1. 将 Mysql 查询的结果导出到 excel?

      时间:2023-05-24
        <tbody id='kUNEo'></tbody>

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

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

              <i id='kUNEo'><tr id='kUNEo'><dt id='kUNEo'><q id='kUNEo'><span id='kUNEo'><b id='kUNEo'><form id='kUNEo'><ins id='kUNEo'></ins><ul id='kUNEo'></ul><sub id='kUNEo'></sub></form><legend id='kUNEo'></legend><bdo id='kUNEo'><pre id='kUNEo'><center id='kUNEo'></center></pre></bdo></b><th id='kUNEo'></th></span></q></dt></tr></i><div id='kUNEo'><tfoot id='kUNEo'></tfoot><dl id='kUNEo'><fieldset id='kUNEo'></fieldset></dl></div>
              • 本文介绍了将 Mysql 查询的结果导出到 excel?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我的需求是存储查询的全部结果

                My requirement is to store the entire results of the query

                SELECT * FROM document 
                WHERE documentid IN (SELECT * FROM TaskResult WHERE taskResult = 2429)
                

                到一个 Excel 文件.

                to an Excel file.

                推荐答案

                实现此目的的典型方法是导出为 CSV,然后将 CSV 加载到 Excel 中.
                您可以使用任何 MySQL 命令行工具来执行此操作,方法是在 SELECT 语句中包含 INTO OUTFILE 子句:

                The typical way to achieve this is to export to CSV and then load the CSV into Excel.
                You can using any MySQL command line tool to do this by including the INTO OUTFILE clause on your SELECT statement:

                SELECT ... FROM ... WHERE ... 
                INTO OUTFILE 'file.csv'
                FIELDS TERMINATED BY ','
                

                有关详细选项,请参阅此链接.

                See this link for detailed options.

                或者,您可以使用 mysqldump 使用 --tab 选项将转储存储为分隔值格式,请参阅 此链接.

                Alternatively, you can use mysqldump to store dump into a separated value format using the --tab option, see this link.

                mysqldump -u<user> -p<password> -h<host> --where=jtaskResult=2429 --tab=<file.csv> <database> TaskResult
                

                提示:如果您没有指定绝对路径而是使用诸如 INTO OUTFILE 'output.csv'INTO OUTFILE './output.csv' 之类的内容,它将输出文件存储到由 show variables like 'datadir'; 指定的目录.

                Hint: If you don't specify an absoulte path but use something like INTO OUTFILE 'output.csv' or INTO OUTFILE './output.csv', it will store the output file to the directory specified by show variables like 'datadir';.

                这篇关于将 Mysql 查询的结果导出到 excel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:MySQL 中的 DOUBLE 与 DECIMAL 下一篇:使用同一表中另一行的数据更新行

                相关文章

                  <tfoot id='r3PPz'></tfoot>
                    <bdo id='r3PPz'></bdo><ul id='r3PPz'></ul>
                  1. <legend id='r3PPz'><style id='r3PPz'><dir id='r3PPz'><q id='r3PPz'></q></dir></style></legend>

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

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