Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 The total amount of sales by stock code How do I f

Author  Topic 

a_self_lion
Starting Member

6 Posts

Posted - 2010-07-27 : 13:18:33
hi,

The total amount of sales by stock code How do I find?

for exemple,

SELECT VRSHAR_STC_CODE, VRSHAR_QUANTITY, VRSHAR_PaymentINFO
FROM VRSHAR
WHERE VRSHAR_PaymentINFO = 'DEBTOR'



All of those sales coming in the query.
I want my code according to the stock sale so bring you're collecting.
STC_CODE------QUANTITY
1111001----------125
1112005----------251
1205106----------350


All match the amount of stock code, written in front of you I want to collect.

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-07-27 : 13:20:28
This?
SELECT VRSHAR_STC_CODE, SUM(VRSHAR_QUANTITY)
FROM VRSHAR
WHERE VRSHAR_PaymentINFO = 'DEBTOR'
GROUP BY VRSHAR_STC_CODE
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-07-27 : 13:21:16
SELECT VRSHAR_STC_CODE, SUM(VRSHAR_QUANTITY), SUM(VRSHAR_PaymentINFO)
FROM VRSHAR
GROUP BY VRSHAR_STC_CODE

???



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

a_self_lion
Starting Member

6 Posts

Posted - 2010-07-28 : 02:48:26
Thank you to everyone who helped.
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-07-28 : 10:10:13
Np. You are welcome.
Go to Top of Page
   

- Advertisement -