Re: Let-bindings in SQL statements

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: Let-bindings in SQL statements
Дата
Msg-id jh5gm7$mrl$5@reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на Let-bindings in SQL statements  (Jon Smark <jon.smark@yahoo.com>)
Ответы Re: Let-bindings in SQL statements  (Marti Raudsepp <marti@juffo.org>)
Список pgsql-general
On 2012-01-26, David Johnston <polobo@yahoo.com> wrote:

> Is it possible to do the equivalent of let-bindings in a pure SQL function?
> I have a SELECT that invokes "now" multiple times.  It would be nicer to do
> it only once and reuse the value.  Something like this:

There is no need. now() is tagged as stable. it will only be executed once.

the planner will figure this out for you.

--
⚂⚃ 100% natural

В списке pgsql-general по дате отправления:

Предыдущее
От: Jasen Betts
Дата:
Сообщение: Re: last entry per person
Следующее
От: Jasen Betts
Дата:
Сообщение: Re: Defining Role Privileges