Re: JOIN

Поиск
Список
Период
Сортировка
От Loredana Curugiu
Тема Re: JOIN
Дата
Msg-id 1c23c8e70706050518v19c56d21j873985125b930db@mail.gmail.com
обсуждение исходный текст
Ответ на Re: JOIN  (Richard Huxton <dev@archonet.com>)
Ответы Re: JOIN  (Richard Huxton <dev@archonet.com>)
Re: JOIN  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-sql

>> So  I have the following query:>>
>>        SELECT SUM(A.count),
>>                      A.theme,
>>                       A.receiver,
>>                      A.dates
>>           FROM my_table A
>> INNER JOIN my_table B
>>               ON A.theme=B.theme
>>             AND A.receiver=B.receiver
>>             AND A.date=ANY(B.dates)
>>  GROUP BY A.theme,A.receiver, A.dates;
[snip]
>>
>> The result is wrong. I don't know what it is wrong at my query.
>> Please help.

You don't actually say what's wrong. What are you expecting as output?

I am trying to say that sum column it is not calculated correctly.  

Oh, and your "date" column isn't - it's a timestamp with time-zone. That
might or might not cause confusion with daylight-saving-times.

Yes, I am working with timestamp with time zone .


Regards,
        Loredana

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: JOIN
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: JOIN