Re: Function in psql to Compare two numbers and return the bigger value

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: Bricklen Anderson <banderson(at)presinet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, adam(dot)r(at)sbcglobal(dot)net
Subject: Re: Function in psql to Compare two numbers and return the bigger value
Date: 2007-02-13 18:55:39
Message-ID: 45D209AB.9040403@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


>> I am looking for a psql method to get the bigger value of two numbers.
>>
>> For example,
>>
>> methodName(12.6, 3.8)
>>
> select greatest(12.6,3.8);

It does not work for me,
select greatest(12.6,3.8);
ERROR: function greatest(numeric, numeric) does not exist
HINT: No function matches the given name and argument types. You may
need to add explicit type casts.

In 8.1 docs, it says that:
GREATEST(value [, ...])
LEAST(value [, ...])

* Note that GREATEST and LEAST are not in the SQL standard, but are a
common extension. *

Does it mean it is not allowed to use "select greatest(12.6,3.8)" ?

thanks

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Emi Lu 2007-02-13 18:58:51 Re: Function in psql to Compare two numbers and return the bigger value
Previous Message Bricklen Anderson 2007-02-13 18:48:26 Re: Function in psql to Compare two numbers and return the bigger value