I used Excel to create numerous SELECT from a list of schema names from a database with lots of identical schemas:
select result from foo.table limit 1; select result from bar.table limit 1; select result from doo.table limit 1;
( foo , bar and doo are examples of my schemes, in fact there are hundreds).
Each SELECT returns only one result. I just need one result column with as many rows as there are schemas. Then I can copy this back to Excel with the schema names.
When I run the query above, I get 1 line and the rest are discarded:
Query result with 1 row discarded.
Query result with 1 row discarded.
Total query runtime: 40 ms.
1 row retrieved.
I tried to use UNION ALL , but limit 1 , which I use to ensure that one row only comes back from each table of the schema so that this does not work.
How can I either prohibit discarding other rows, or write a query that will return the values ββI need (two columns - schema_name, the result - one row for each schema)?
source share