Re: Fw: Count rows group by time intervals

Поиск
Список
Период
Сортировка
От Oliveiros Cristina
Тема Re: Fw: Count rows group by time intervals
Дата
Msg-id 006201c792f2$d7c01860$ec5a3d0a@marktestcr.marktest.pt
обсуждение исходный текст
Ответ на Fw: Count rows group by time intervals  ("Oliveiros Cristina" <oliveiros.cristina@marktest.pt>)
Ответы Re: Fw: Count rows group by time intervals  ("Loredana Curugiu" <loredana.curugiu@gmail.com>)
Список pgsql-novice
Yes,I've already figured out the mistake.
Can you please try this one?
Please Tell me if it worked
 
 
SELECT   a."date",a."theme",a.receiver,COUNT(*)
FROM (SELECT DISTINCT * FROM t_loredana) a
INNER JOIN t_loredana b
ON a."theme" = b."theme" AND a.receiver = b.receiver
WHERE (((b."date" - a."date") = 1) OR (b."date" - a."date") = 0)
GROUP BY a."date",a."theme",a.receiver
HAVING (a."date" - '2007-01-01' ) % 2 = 0
ORDER BY a."date"
----- Original Message -----
Sent: Thursday, May 10, 2007 8:15 AM
Subject: Re: Fw: [NOVICE] Count rows group by time intervals

Hi Oliveiros,

With your query I get the following result

          date                    | theme  |      receiver     | count
------------------------------------+----------+----------------------+-------
 2007-04-27 00:00:00+00 | MIA    | +40741775621 |    25
 2007-04-25 00:00:00+00 | LIA     | +40741775621 |    50
 2007-05-09 00:00:00+00 | MIA    | +40741775621 |     1
 2007-04-27 00:00:00+00 | LIA     | +40741775621 |    81

The count it is not correct.

Best,
      Loredana

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

Предыдущее
От: "Loredana Curugiu"
Дата:
Сообщение: Count rows by day interval
Следующее
От: "Loredana Curugiu"
Дата:
Сообщение: Re: Fw: Count rows group by time intervals