KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Working with multiple databases #1204

Closed Vijit Atreya Paudel opened this topic on on Dec 4, 2019 - 1 comments

Vijit Atreya Paudel commented on Dec 4, 2019

Hi, I have a scenario. I have two different databases: AuthorDB and BooksDB. AuthorDB has a table Authors (id,Name) and BooksDB has a table Books(id, title, authorId). I need to make a report for all the Books written by an author(authorId). Is there any way to make use of tables in two different databases?

David Winterburn commented on Dec 5, 2019

Hi,

You can join multiple datastores like this:

https://www.koolreport.com/docs/datastore/overview/#join-methods

But if your 2 databases are the same type and using the same credential it could be more efficient to join them with sql. For example in MySQL:

SELECT <...>
FROM dbA.table1 t1 JOIN dbB.table2 t2 ON t2.column2 = t1.column1;

Let us know if you have more questions. Thanks!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None