When writing a question in SQL, if it possible to use a variable to determine which database gets used for the question?
For example, if I have a database "US Customers" and one "EU Customers", can both contain tables called sales
, can I do something in a question so that a variable chooses the database?
select *
from case when {{var}} = "US" then Sales (US customers) else Sales (EU Customers) end
rather than having to create two copies of the same question, just using the different databases?