Search Postgresql Archives

Re: greatest/least semantics different between oracle and postgres

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Bruno Wolff III" <bruno@xxxxxxxx> 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.

Perhaps coalesce(greatest(a,b), coalesce(a,b)) is more legible?

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux