Re: timespan casting

Поиск
Список
Период
Сортировка
От Ed Loehr
Тема Re: timespan casting
Дата
Msg-id 3952C394.67050AC5@austin.rr.com
обсуждение исходный текст
Ответ на timespan casting  (Jeff MacDonald <jeff@pgsql.com>)
Список pgsql-sql
Jeff MacDonald wrote:
> bignose=> select start,stop, stop-start as start_stop from foo;
>          start          |          stop          | start_stop
> ------------------------+------------------------+------------
>  2000-06-22 20:37:12-03 | 2000-06-22 20:37:12-03 | 00:000
> 
> now my question.. first of all is the first start_stop result a little
> off ? (talking about the 3 0's..)

What's off about it??  Your start and stop appear identical.

> second is there a way i can do a select so it says something more human
> usable ie : 100 days 22 hours 32 minutes..

Try to_char().  http://www.postgresql.org/docs/postgres/x2976.htm

Regards,
Ed Loehr


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

Предыдущее
От: Ryan Kirkpatrick
Дата:
Сообщение: Re: [GENERAL] Sequences do not obey transactions...
Следующее
От: darcy@druid.net (D'Arcy J.M. Cain)
Дата:
Сообщение: Re: Using substr with user defined types