Sum If

Поиск
Список
Период
Сортировка
От Daniel Hernandez
Тема Sum If
Дата
Msg-id 20060223174644.073502F616@xprdmxin.myway.com
обсуждение исходный текст
Ответы Re: Sum If
Список pgsql-sql
Hi Guys,<br /><br />�� I'm new on this group, and I have a question, is there a way to do a "sum if" (kind of)?<br
/><br/>What i want to do is the following.<br /><br />Select customers.custid, if (sales.itemname = 'candy',
sum(sales.count))as "Sales candies", if (sales.itemname = 'some', sum(sales.count)) as "Sales Some"<br />from ...<br
/>join...<br />where .....<br />group by customers.custid ...<br /><br /><br />Thanks in advanced, and best regards,<br
/><br/><br />Daniel Hern�ndez.<br />Tijuana, BC, M�xico.<br />"More you learn, more you earn".<p><hr /><font
face="geneva"size="2"><b>Join Excite! - <a href="http://www.excite.com"
target="_blank">http://www.excite.com</a></b><br/>The most personalized portal on the Web!</font> 

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

Предыдущее
От: PFC
Дата:
Сообщение: Re: 'locking' the SELECTs based on indices...
Следующее
От: "Jim Buttafuoco"
Дата:
Сообщение: Re: Sum If