BigBrother
Programmer
Does anyone know if there's a way to create a select statement where the FROM clause references tables listed in a field from another table?
So, for example let's say I have a database that stores data on 3,000 different stocks accross the nyse. Assume each stock has its own table with the following fields: date, open, high, low, close, volume. A Tickers table stores each stock's symbol, name, and table_name where its data can be found.
So the question is, is there a way to construct a SELECT statement that will use the table_name field in the Tickers table to select data accross the other 3,000 stock tables?
So, for example let's say I have a database that stores data on 3,000 different stocks accross the nyse. Assume each stock has its own table with the following fields: date, open, high, low, close, volume. A Tickers table stores each stock's symbol, name, and table_name where its data can be found.
So the question is, is there a way to construct a SELECT statement that will use the table_name field in the Tickers table to select data accross the other 3,000 stock tables?