Let-bindings in SQL statements
| От | Jon Smark |
|---|---|
| Тема | Let-bindings in SQL statements |
| Дата | |
| Msg-id | 1327588669.84153.YahooMailNeo@web112810.mail.gq1.yahoo.com обсуждение исходный текст |
| Ответы |
Re: Let-bindings in SQL statements
Re: Let-bindings in SQL statements Re: Let-bindings in SQL statements Re: Let-bindings in SQL statements |
| Список | pgsql-general |
Hi, 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: LET right_now = SELECT now () IN SELECT * FROM my_table WHERE right_now >= start AND ... In PL/pgSQL this is easy, but I wonder about SQL... Thanks in advance! Jon
В списке pgsql-general по дате отправления: