合并数据库

编程入门 行业动态 更新时间:2024-10-11 17:26:20
本文介绍了合并数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

目前,我有apprx。 20相同的结构化数据库(SQLite的)这是我从遥远的目的地(Android手机),以我的电脑转移。现在我想将它们添加到一个单一,以进行数据分析上的数据。这怎么可能?该表的主键是自动递增的整数,因此当使用附加我得到一个主键是不唯一的错误。此外,它会很好,如果我能以某种方式让它们来自何处行和表之间的参考。

At the moment I have apprx. 20 identical structured databases(SQLite) which I transferred from remote destinations (android phones) to my pc. Now I want to add them to a single one in order to perform data analysis on the data. How is this possible? The primary keys of the tables are auto-increment integer , so when using ATTACH I get a Primary key is not unique error. In addition it would be nice if i could somehow keep a reference between the rows and the tables which are coming from.

推荐答案

你措辞的问题的方法,这听起来好像是一个一次性的操作,你正在做一台家用电脑上。我想可能只是打开了 sqlite的外壳一个全新的数据库,并附加/从插入/分离的每个数据库像他们展示在的链接。

The way you worded the question, it sounds to me like it is a one-time operation you're doing on a home PC. I would probably just open a fresh database in the sqlite shell and attach/insert from/detach each database like they show on that link.

如果你需要这个脚本,此链接具有嵌入到sqlite的一个例子shell脚本和这个显示了DOS批处理文件中的一些SQL。更多preferably,你可以$ C C $它与你喜欢的语言的SQLite的绑定,如 Python的。

If you need to script this, this link has an example of embedding sqlite into shell scripts and this one shows some sql in a dos batch file. More preferably, you could code it up with your favorite language's sqlite bindings, like Python's.

更多推荐

合并数据库

本文发布于:2023-11-25 06:44:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1628719.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!