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

Поиск
Список
Период
Сортировка
От Emi Lu
Тема Re: Function in psql to Compare two numbers and return the bigger value
Дата
Msg-id 45D20A6B.9060409@encs.concordia.ca
обсуждение исходный текст
Ответ на Re: Function in psql to Compare two numbers and return the bigger value  (Emi Lu <emilu@encs.concordia.ca>)
Список pgsql-general
Emi Lu wrote:
>
>>> 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)" ?

I see the reason, my version is 8.0.8. The doc is for 8.1.

Thank you for all your help!

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

Предыдущее
От: Emi Lu
Дата:
Сообщение: Re: Function in psql to Compare two numbers and return the bigger value
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: PostgreSQL and OpenLdap