简体   繁体   English

在Monetdb中查询两个数据库

[英]Query two databases in Monetdb

Im using monetdb and i have two databases on it "mydb" and "test". 即时通讯使用monetdb,我有两个数据库“ mydb”和“ test”。

I want to get a sub-set of values from 'mydb' into 'test'. 我想将值的子集从“ mydb”转换为“ test”。

My code: 我的代码:

 insert into test.result 
select sum(chargfeeprepaid) from mydb.data where callingpartyno = 628388881507 
union 
select sum(chargefeeprepaid) from mydb.sms where callingpartyno = 628388881507;

This works fine in MySQL...but in Monetdb i get the error: INSERT INTO: no such scheme 'test'. 这在MySQL中工作正常...但是在Monetdb中,我得到了错误:INSERT INTO:没有这样的方案'test'。

Where did i go wrong and what is the correct syntax to do this in monetdb? 我在哪里出错了?在monetdb中执行此操作的正确语法是什么?

Greetings Seleen 硒的问候

There is no way to do this in MonetDB. MonetDB中无法执行此操作。 Every Database is served by it's own process (mserver) and there is no sharing between them. 每个数据库都由其自己的进程(服务器)提供服务,并且它们之间没有共享。

If you want to migrate data from one database to another you have to either copy the data using the copy commands (see http://goo.gl/OXkto ) or dump the data as sql inserts using the dump commands ( http://goo.gl/5Bfrf and http://goo.gl/EuPwE ). 如果要将数据从一个数据库迁移到另一个数据库,则必须使用复制命令复制数据(请参阅http://goo.gl/OXkto ),或使用转储命令将数据作为sql插入来转储( http:// goo.gl/5Bfrfhttp://goo.gl/EuPwE )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM