Re: LEAST and GREATEST functions?

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: LEAST and GREATEST functions?
Дата
Msg-id 200307011704.26768.josh@agliodbs.com
обсуждение исходный текст
Ответ на Re: LEAST and GREATEST functions?  (Joe Conway <mail@joeconway.com>)
Ответы Re: LEAST and GREATEST functions?  (Joe Conway <mail@joeconway.com>)
Список pgsql-sql
Joe,

> create or replace function greatest(anyelement, anyelement) returns
> anyelement as 'select case when $1 > $2 then $1 else $2 end' language
> 'sql';

Way cool.  I'd have to imagine that it would blow up if you did this, though:

select greatest ( 512, now() );

With an "Operator is not defined" error, hey?


-- 
Josh Berkus
Aglio Database Solutions
San Francisco


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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: LEAST and GREATEST functions?
Следующее
От: Joe Conway
Дата:
Сообщение: Re: LEAST and GREATEST functions?