gpt4 book ai didi

mysql - 将选定记录从 MySQL 数据库导出到 SQLite 数据库需要哪些命令?

转载 作者:行者123 更新时间:2023-11-29 05:43:36 24 4
gpt4 key购买 nike

我想编写一个支持以下工作流程的脚本。

  1. 给定:一组已定义的查询(带有表连接的选择语句)从单个 MySQL 数据库返回数据集
  2. 创建:一个 SQLite 数据库,其中包含向步骤 1 中发送的同一组查询返回相同结果所需的信息(表、数据)。

除了选择、删除和更新之外,我对 SQL 相对不熟悉,所以我希望了解特定的命令行或 SQL 语法...除了安装 SQLite 之外需要的任何东西。

最佳答案

这是一个一半的答案,但对其他类型的数据库也很有用。
mysqldump 有选项“compatible”来控制转储的 sql 的标准合规性。从“mysqldump --help”执行:

  --compatible=name   Change the dump to be compatible with a given mode. By
default tables are dumped in a format optimized for
MySQL. Legal modes are: ansi, mysql323, mysql40,
postgresql, oracle, mssql, db2, maxdb, no_key_options,
no_table_options, no_field_options. One can use several
modes separated by commas. Note: Requires MySQL server
version 4.1.0 or higher. This option is ignored with
earlier server versions.

关于mysql - 将选定记录从 MySQL 数据库导出到 SQLite 数据库需要哪些命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4523183/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com