On Thu, Sep 26, 2002 at 04:04:14PM -0700, Scott Chapman wrote:
> I have a situation where a table contains table names. I need to know if I
> can make a Postgresql query that will have a subquery which supplies the
> table name I want to deal with. Can this be done?
>
> Something like this:
> select column from (select table_name from table2 where key=value) where
> key=value;
The answer is no. You may be able to fudge it by creating a plpgsql function
that builds the query on the fly but it will probably suck performance-wise.
Sounds like your database structure is not properly normalised.
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.