一些很有用的SQLite命令总结

2022-12-08 0 214

显示表结构:复制代码 代码如下:sqlite> .schema [table]获取所有表和视图:复制代码 代码如下:sqlite > .tables 获取指定表的索引列表:复制代码 代码如下:sqlite > .indices [table ]导出数据库到 SQL 文件:复制代码 代码如下:sqlite > .output [filename ] sqlite > .dump sqlite > .output stdout从 SQL 文件导入数据库:复制代码 代码如下:sqlite > .read [filename ]格式化输出数据到 CSV 格式:复制代码 代码如下:sqlite >.output [filename.csv ] sqlite >.separator , sqlite > select * from test; sqlite >.output stdout从 CSV 文件导入数据到表中:复制代码 代码如下:sqlite >create table newtable ( id integer primary key, value text ); sqlite >.import [filename.csv ] newtable 备份数据库:复制代码 代码如下:/* usage: sqlite3 [database] .dump > [filename] */sqlite3 mytable.db .dump > backup.sql恢复数据库:复制代码 代码如下:/* usage: sqlite3 [database ] < [filename ] */ sqlite3 mytable.db < backup.sql

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

悠久资源 SQLite数据库 一些很有用的SQLite命令总结 https://www.u-9.cn/sql/sqlite/6198.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务

  • 0 +

    访问总数

  • 0 +

    会员总数

  • 0 +

    文章总数

  • 0 +

    今日发布

  • 0 +

    本周发布

  • 0 +

    运行天数

注册会员,众多资源免费下载