How to export all collections of sql query statements?

How to export all collections of sql query statements at once?
for example,

Hi @beta
I think something got lost in translation. What are you trying to do?

I want to export all the SQL statements below the collection at once.
For example, like this,
select * from tableA where {{nick}};
select * from tableB where {{nick}};
select * from tableC where {{nick}};
select * from tableD where {{nick}};

You cannot use a Field Filter on different tables in the same query, since it uses the referenced table.column - and aliases are not supported.

As you said, the querys are stored in
I want to export all these queryes;

Okay, that’s a very different question.
You’ll need a SQL query tool such as to read, which is a H2 database.
The Metabase questions are stored in the table report_card.

OK,Thank you very much,
maybe my previous expression is not clear.:joy:

Hi, if you want to do this in a single query, and the fields of the tables are somewhat comparable, you can use a SQL UNION to achieve this:

SELECT nick, name, foo FROM tableA WHERE {{nick}}
SELECT nick, name, bar FROM tableB WHERE {{nick}}
SELECT nick, name, NULL FROM tableC WHERE {{nick}}

No, you cannot use the same Field Filter on different tables, since aliases are not supported, and Metabase generates the SQL with full table.column syntax.

Ah, thanks. You are right :frowning:
Aliasing the table doesn’t help either (on PostgreSQL) because the schema is included.

Well you can use UNION ALL by replacing the WHERE clause with:
WHERE nick = {{your_selection}}

You don’t get a dropdown list but if you know what info you need it will do the trick.