Skip site navigation (1) Skip section navigation (2)

Re: Fw: Count rows group by time intervals

From: "Oliveiros Cristina" <oliveiros(dot)cristina(at)marktest(dot)pt>
To: "Loredana Curugiu" <loredana(dot)curugiu(at)gmail(dot)com>,<pgsql-novice(at)postgresql(dot)org>
Subject: Re: Fw: Count rows group by time intervals
Date: 2007-05-09 15:14:17
Message-ID: 00c701c7924c$b61e0920$ec5a3d0a@marktestcr.marktest.pt (view raw or flat)
Thread:
Lists: pgsql-novice
Ops... Mine is 8.2 beta 3...
With High probability the problem is difference in versions...

Well, Loredana, I have to say that Ive never used your version, so probably I cannot be a big help, then.

But you seem to know how to convert intervals to integers with the datepart()::int thing. 

then Please try to enhance my query adding that to the three parts where I use date differences

Best,

Oliveiros
  ----- Original Message ----- 
  From: Loredana Curugiu 
  To: Oliveiros Cristina ; pgsql-novice(at)postgresql(dot)org 
  Sent: Wednesday, May 09, 2007 4:01 PM
  Subject: Re: Fw: [NOVICE] Count rows group by time intervals




    Funny thing.
    In mine, it works...
    On mine, If I subtract one date  from the other I get the number of days in between...which is another integer, I guess. and '%'  is the modular operator. Doesnt it work like this on yours?

   
  If I substract one date from the other I get an interval.



    Which version are you using?

  I am using 7.4.12 version of postgres.



    try

    SELECT (date - '2007-01-01') % 2 
    FROM table

    to see if you get zeroes and ones . 


  It's not working. I've got the same error. 


In response to

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2007-05-09 15:28:18
Subject: Re: Fw: Count rows group by time intervals
Previous:From: Loredana CurugiuDate: 2007-05-09 15:10:08
Subject: Re: Fw: Count rows group by time intervals

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group