---
title: "How to combine queries from multiple databases"
canonical: "https://support.appfire.com/space/SUPPORT/89138154/How%20to%20combine%20queries%20from%20multiple%20databases"
format: markdown
---
## <span style="color: #000000">Description</span>

<span style="color: #000000">The SQL macros make it possible to combine queries from multiple databases and data sources by using embedded SQL macros. This is a very powerful technique to integrate diverse data into a single view for data consumers. This makes for limitless opportunities based on using crafty SQL. In some cases, it can be tricky, but the results are worth it.</span>

<span style="color: #000000">The technique is exactly the same as with nested queries</span> <span style="color: #000000">with the only difference being the data source you choose on each of the inner queries.</span>

## <span style="color: #000000">Related article</span>

- [<span style="color: #000000">How to have queries within queries</span>](https://appfire.atlassian.net/wiki/spaces/SUPPORT/pages/89138219)