Re: greatest/least semantics different between oracle and postgres
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: greatest/least semantics different between oracle and postgres |
| Дата | |
| Msg-id | 25612.1183217690@sss.pgh.pa.us обсуждение |
| Ответ на | Re: greatest/least semantics different between oracle and postgres (Gregory Stark <stark@enterprisedb.com>) |
| Ответы |
Re: greatest/least semantics different between oracle and postgres
|
| Список | pgsql-general |
Gregory Stark <stark@enterprisedb.com> writes:
> "Bruno Wolff III" <bruno@wolff.to> writes:
>> Also what value should I have used in a coalesce to guaranty still getting
>> the maximum?
> I would expect coalesce(coalesce(greatest(a,b),a),b) to do what you want. It's
> not terribly legible though and if a and b are subselects I would worry a
> little about the optimizer rerunning them unnecessarily.
That does not work correctly for volatile functions, and it does not
scale to more than two inputs either -- you'd get the first nonnull
not the largest one.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера