Re:

Поиск
Список
Период
Сортировка
От Christoph Haller
Тема Re:
Дата
Msg-id 423E99E2.7D428966@rodos.fzk.de
обсуждение исходный текст
Ответ на ...  ("Octavio Alvarez" <alvarezp@tecbc.mx>)
Ответы Re: Your question about date  (Béatrice Yueksel <beatrice.yueksel@it-raum.ch>)
Список pgsql-sql
Octavio Alvarez wrote:
> 
> Sorry, I tried to make my subject as good as possible.

Ahem, what subject? 
> 
> I have a table where I store the dates in which I take out of my inventory
> (like "installation dates")
> 
> table
> ---------------
> row_id   SERIAL
> date     DATE
> fk_item  INTEGER
> 
> and that's pretty much it.
> 
> I want to have a query returning how long have been certain items lasting.
> 
> Say I have:
> 
> SELCT date FROM table WHERE fk_item = "INKJET_INK-BW"
> 
> date
> -------------
> 2005-02-02
> 2005-03-05
> 2005-04-07
> 2005-05-02
> 
> I need something to calculate the intervals between those dates, like this:
> 
> intervals (in days)
> --------------------
>   31
>   34
>   25
> 
> So I can get the stddev and stuff from the "duration" of the items.
> 
> I've been having a hard time with it. I'm trying NOT to program new
> functions.

I cannot see how this could be achieved without the use of a function. 
But if there is a way after all, I would be interested in learning it. 
> 
> Any help will be appreciated.
> 
> --Octavio
> --

Regards, Christoph


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: index scan
Следующее
От: Mihail Nasedkin
Дата:
Сообщение: Re: index scan