Re: Interval FAQ - please review

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Interval FAQ - please review
Дата
Msg-id web-103582@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на Re: Interval FAQ - please review  ("Jeff Eckermann" <jeckermann@verio.net>)
Список pgsql-sql
Jeff,

> Why not just include examples of DATEDIFF and DATEADD functions?
> For example:
> CREATE FUNCTION datediff(timestamp, timestamp)
> RETURNS integer AS '
> BEGIN
> RETURN $2 - $1;
> END;
> ' LANGUAGE 'plpgsql';

Not a bad idea.  Unfortunately, DATEDIFF & DATEADD are more complicated
than that.  More importantly, I don't want to get into Function design
in this article, which is aimed at newbies.

If, however, anyone *does* have an online sample of one or both of these
two functions, I'd love to link to it from the article.

-Josh

______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


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

Предыдущее
От: Vivek Khera
Дата:
Сообщение: Re: Re: Interval FAQ - please review
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: Re: Interval FAQ - please review