Converting/formatting timestamp arithmetic

Поиск
Список
Период
Сортировка
От eel@javabox.com (Eel)
Тема Converting/formatting timestamp arithmetic
Дата
Msg-id a62a408.0203071741.7cbb5d3b@posting.google.com
обсуждение исходный текст
Ответы Re: Converting/formatting timestamp arithmetic  (Karel Zak <zakkr@zf.jcu.cz>)
Список pgsql-general
Hi,
  Is there any easy way to convert the result of timestamp
arithmetic to a simple decimal number?

I have something like:

select current_timestamp - timein as daysat from transcations

daysat looks like:

3 days 12:00:00

I want it to look like:

3.5

I fooled around a bit to_number(text, text).  It seems like
I would need something that would parse out the days and hours
or else a global formatting flag.  I guess I could write my
own function, but was wondering if there's some better way.

Thanks!

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

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: [NOVICE] Conditional constraint?
Следующее
От: mdb002@yahoo.com (mdb)
Дата:
Сообщение: Re: Temp Tables