Re: Tabulate data incrementally

From: Richard Huxton <dev(at)archonet(dot)com>
To: Omar Eljumaily <omar2(at)omnicode(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Tabulate data incrementally
Date: 2007-03-08 15:15:15
Message-ID: 45F02883.6040405@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Omar Eljumaily wrote:
> 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?

Try one of these:

=> SELECT date_trunc('week',now());
date_trunc
------------------------
2007-03-05 00:00:00+00

=> SELECT extract(week from now());
date_part
-----------
10

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Csaba Nagy 2007-03-08 15:16:25 Re: OT: Canadian Tax Database
Previous Message Omar Eljumaily 2007-03-08 15:00:43 Tabulate data incrementally