Re: SUM not matching up on a JOIN

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SUM not matching up on a JOIN
Дата
Msg-id 11414.1130359913@sss.pgh.pa.us
обсуждение исходный текст
Ответ на SUM not matching up on a JOIN  (Tyler Kellen <sleekcode@gmail.com>)
Список pgsql-sql
Tyler Kellen <sleekcode@gmail.com> writes:
> Why is my discount total different when I
> left join the trans table to the totals?

Are you sure that trans_item.trans_id is unique and accounts for all the
existing values of trans.id?  I don't see any unique index or foreign
key constraints in your \d output, so the database isn't enforcing that
condition for you ...
        regards, tom lane


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

Предыдущее
От: Mario Splivalo
Дата:
Сообщение: Re: RETURNS SETOF primitive returns results in parentheses
Следующее
От: "Thomas F. O'Connell"
Дата:
Сообщение: Re: SQL Functions