I have a database with ~ 1000 tables where each table has the column date
.
I want to see how many tables are between the date 2000 and 2016.
Each table is a company name, so that I get all the companies funded between 2000 and 2016 I would need this query.
I tried it with something like
SELECT *
FROM date
WHERE date BETWEEN 2000 AND 2020;
but the problem is, that I need to do it for all ~ 1000 tables.
Is there a way to write an easy loop for a SQL query?
Thanks for your help.
question from:https://stackoverflow.com/questions/65559788/how-to-write-a-sql-query-for-multiple-tables-without-join