Re: How this query!

Поиск
Список
Период
Сортировка
От Lars Haugseth
Тема Re: How this query!
Дата
Msg-id 87pss2qkan.fsf@skapulf.larshaugseth.com
обсуждение исходный текст
Ответ на How this query!  ("Richard Susanto" <richard@orbisindonesia.com>)
Список pgsql-admin
* richard@orbisindonesia.com ("Richard Susanto") wrote:
|
| Folks,
| would you like help me how to query this case.
|
| I have tbl_a, the fields are :
| item_record
| item_product_name
| item_qty
|
|
| if the data are :
|
| item_record = 1,2,3,4,5,6
| item_product_name = a,b,a,c,d,c,...
| item_qty = 10,5,15,10,20,5,...
|
| How the query to sum item_qty_total if i want the result :
| item_product_name = a,b,c,d
| item_qty_total = 25,5,15,20

SELECT item_product_name, sum(item_qty) FROM tbl_a GROUP BY item_product_name;

--
Lars Haugseth

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

Предыдущее
От: "Richard Susanto"
Дата:
Сообщение: How this query!
Следующее
От: jose fuenmayor
Дата:
Сообщение: size of indexes and tables (more than 1GB)