dynamic rules?

From: "Christopher Dedels" <cdedels(at)mygeotivity(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: dynamic rules?
Date: 2004-06-04 04:32:47
Message-ID: 20040604043444.845E4D1B1DF@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Is it possible to create a select rule that returns results depending on a
where clause in the original select statement?

For Example (oversimplified):

CREATE TABLE one (data int);
CREATE TABLE two (data int);

I make the query:
SELECT data FROM number WHERE type=1;

If the type is 1 (type=1) I want to return 'SELECT data FROM one;'
If the type is 2 (type=2) I want to return 'SELECT data FROM two;'

Thanks,

Chris

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Greg Stark 2004-06-04 06:11:28 Re: Selecting "sample" data from large tables.
Previous Message Josh Berkus 2004-06-03 23:09:51 Re: [SQL] SQL Spec Compliance Questions