Re: Aggregate question (Sum)

Поиск
Список
Период
Сортировка
От Rodrigo De León
Тема Re: Aggregate question (Sum)
Дата
Msg-id a55915760711191311s115535d5ofe9d0ebb99714b9b@mail.gmail.com
обсуждение исходный текст
Ответ на Aggregate question (Sum)  ("Luiz K. Matsumura" <luiz@planit.com.br>)
Ответы Re: Aggregate question (Sum)
Список pgsql-sql
On Nov 19, 2007 3:46 PM, Luiz K. Matsumura <luiz@planit.com.br> wrote:
> If someone can give me some hint I will apreciate.

This is more of a normalization problem. See:

http://www.deeptraining.com/litwin/dbdesign/FundamentalsOfRelationalDatabaseDesign.aspx

and lookup Third Normal Form.

You have a calculated total for each order, so I assume there's a
price for every product. You should join order_item to whichever table
has the individual cost for each product and multiply it by
order_item.qty.

Good luck.


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

Предыдущее
От: "Luiz K. Matsumura"
Дата:
Сообщение: Aggregate question (Sum)
Следующее
От: "Luiz K. Matsumura"
Дата:
Сообщение: Re: Aggregate question (Sum)