Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

How can I to join two tables from two servers?

In MySQL, I have two different databases -- let's call them A and B.

Database A resides on server server1, while database B resides on server server2.

Is it possible to perform a SQL JOIN between a table that is in database A, to a table that is in database B?

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: How can I to join two tables from two servers?

Hi,

Try this script

ODBC CONNECT TO [MySQL Servidor];

Tab1:

SELECT *

transactions_backup.transaction_at,

year(transactions_backup.transaction_at),

month(transactions_backup.transaction_at),

transactions_backup.event_type_id,

transactions_backup.ad_id AS AdID,

transactions_backup.campaign_id  AS CampaignID

FROM transactions_backup

where transactions_backup.event_type_id in (3, 13, 18)

and transactions_backup.ad_id = offers.ad_id

ODBC CONNECT TO MySQL *******;

Tab2:

JOIN (Tab1) SELECT

offers.ad_id AS AdID

offers.property,

offers.provider,

offers.price

FROM offers;

Tab3:

JOIN (Tab1) SELECT

campaigns.id as CampaignID,

*

FROM campaigns

WHERE campaigns.campaign_type = 4;

Hope this helps you.

Regards,

Jagan.

3 Replies
Not applicable

Re: How can I to join two tables from two servers?

Dear

first establish the connectivity from Server1 and read the table A.

then establish the connectivity from server 2 and read the table B.

and apply the join.

like,

Connectivity server1;

TableA;

load

..........

table A from server1

;

connectivity from server2:

Left join(TableA)

load

......

table 2 from server 2;

Thanks,

Mukram.

Not applicable

Re: How can I to join two tables from two servers?

Hi Mukram,

How can I make the following join "and transactions_backup.ad_id = offers.ad_id" in Tab2 and "and transactions_backup.campaign_id = campaigns.id" in Tab3? The fields names are different in case 2.

Regards,

Paula

---

ODBC CONNECT TO [MySQL Servidor];

Tab1:

SELECT *

transactions_backup.transaction_at,

year(transactions_backup.transaction_at),

month(transactions_backup.transaction_at),

transactions_backup.event_type_id,

transactions_backup.ad_id,

transactions_backup.campaign_id id

FROM transactions_backup

where transactions_backup.event_type_id in (3, 13, 18)

and transactions_backup.ad_id = offers.ad_id

ODBC CONNECT TO MySQL *******;

Tab2:

JOIN (Tab1) SELECT

offers.property,

offers.provider,

offers.price

FROM offers;

and transactions_backup.ad_id = offers.ad_id

Tab3:

JOIN (Tab1) SELECT

FROM campaigns

WHERE campaigns.campaign_type = 4;

and transactions.campaign_id = campaigns.id

MVP & Luminary
MVP & Luminary

Re: How can I to join two tables from two servers?

Hi,

Try this script

ODBC CONNECT TO [MySQL Servidor];

Tab1:

SELECT *

transactions_backup.transaction_at,

year(transactions_backup.transaction_at),

month(transactions_backup.transaction_at),

transactions_backup.event_type_id,

transactions_backup.ad_id AS AdID,

transactions_backup.campaign_id  AS CampaignID

FROM transactions_backup

where transactions_backup.event_type_id in (3, 13, 18)

and transactions_backup.ad_id = offers.ad_id

ODBC CONNECT TO MySQL *******;

Tab2:

JOIN (Tab1) SELECT

offers.ad_id AS AdID

offers.property,

offers.provider,

offers.price

FROM offers;

Tab3:

JOIN (Tab1) SELECT

campaigns.id as CampaignID,

*

FROM campaigns

WHERE campaigns.campaign_type = 4;

Hope this helps you.

Regards,

Jagan.

Community Browser