Re: Is this possible or am I on drugs :)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: shawn everett <everett(at)pgweb(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Is this possible or am I on drugs :)
Date: 2000-11-28 06:50:28
Message-ID: 13921.975394228@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

shawn everett <everett(at)pgweb(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jens Hartwig 2000-11-28 08:01:08 Damaged table "pg_access"
Previous Message Tod McQuillin 2000-11-28 06:48:46 Re: Is this possible or am I on drugs :)