Search Postgresql Archives

Re: Tabulate data incrementally

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux