Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
JHoek
Contributor
Contributor

Loop through multiple tables with filter

I'm trying to create a script to loop through a few tables.

I'm using a database with different administrations. Each administration has his own prefix.  But in this example i'd only like to select a few administrations, so for example:

There are 20 administrations:

1. administration1$_Testtable

2.  administration2$_Testtable

3.  administration3$_Testtable

4-20. Etc >>

If i wanted it all i could have done this:

SELECT 
"data"
FROM *_Testtable;

But I would only like to retreive a few selected administrations.

Is it possible to build a list where i can loop through? or should i just select each specific table and then concatenate them?

Thanks in advance!

1 Solution
1 Reply