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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Is this possible or am I on drugs :)
Дата
Msg-id 13921.975394228@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Is this possible or am I on drugs :)  (shawn everett <everett@pgweb.com>)
Список 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 по дате отправления:

Предыдущее
От: Tod McQuillin
Дата:
Сообщение: Re: Is this possible or am I on drugs :)
Следующее
От: Jens Hartwig
Дата:
Сообщение: Damaged table "pg_access"