Tabulate data incrementally

Поиск
Список
Период
Сортировка
От Omar Eljumaily
Тема Tabulate data incrementally
Дата
Msg-id 45F0251B.2010807@omnicode.com
обсуждение исходный текст
Ответы Re: Tabulate data incrementally  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Tabulate data incrementally  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
I want to tabulate time data on a weekly basis, but my data is entered
on a daily basis.

create table time_data
{
    employee varchar(10),
    _date date,
    job varchar(10),
    amount
}

So I want to tabulate with a single sql command.  Is that possible?

If I had a separate week end table
create table week_ends
{
    end_date date
}

I could do something like.

select *, (select sum(amount) from time_data where _date > end_date - 7
and _data <= end_date) from week_ends;

 But the week_end table would be a pain to manage for a number of
reasons.  Is it possible to do this without the week_end table?

Thanks.


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

Предыдущее
От: "Ted Byers"
Дата:
Сообщение: Re: OT: Canadian Tax Database
Следующее
От: Csaba Nagy
Дата:
Сообщение: Re: OT: Canadian Tax Database