I have a large number of tables with a common naming convention
basically:
table001, table002, table003 ... table00n
I would like to do a query across all of the tables, however I do not
know all of the tables before hand, and I do not want to manually
generate a query like
select * from table001, table002, table003
I have a query that returns the names of the tables I want to query, it is basically like this:
select tablename from pg_tables where tablename like 'table%'
How do I do this? I've tried creating a Table Function that
returns the above set and tried to use that in a select clause, but I
cant get it to work either.
Thanks for the help
- [SQL] query tables based on a query solarsail
- Re: [SQL] query tables based on a query Bruno Wolff III