Re: Tabulate data incrementally - Mailing list pgsql-general

From Richard Huxton
Subject Re: Tabulate data incrementally
Date
Msg-id 45F02883.6040405@archonet.com
Whole thread Raw
In response to Tabulate data incrementally  (Omar Eljumaily <omar2@omnicode.com>)
Responses Setting week starting day (was: Re: Tabulate data incrementally)  (Jorge Godoy <jgodoy@gmail.com>)
List 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Tabulate data incrementally
Next
From: altudela@gmail.com
Date:
Subject: "oracle to postgresql" conversion