Re: Is this possible or am I on drugs :) - Mailing list pgsql-general

From Tom Lane
Subject Re: Is this possible or am I on drugs :)
Date
Msg-id 13921.975394228@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is this possible or am I on drugs :)  (shawn everett <everett@pgweb.com>)
List pgsql-general
shawn everett <everett@pgweb.com> writes:
> The basic select statement for my problem is going to work as follows:

> select colA, colB, colA+colB*0.4 as f1, colC, colC+colD*9 as f2 from table
> where date=SomeDateEnteredByTheUser;

OK, no problem:

create view myview as
select date, colA, colB, colA+colB*0.4 as f1, colC, colC+colD*9 as f2
from table;

Then your app does

select * from myview where date = SomeDateEnteredByTheUser;

(if you don't want to include the date in the display, you can't
just write * for the output columns, but hopefully you get the
idea now...)

            regards, tom lane

pgsql-general by date:

Previous
From: Tod McQuillin
Date:
Subject: Re: Is this possible or am I on drugs :)
Next
From: Jens Hartwig
Date:
Subject: Damaged table "pg_access"