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
 sql command to pull data from the following table

Author  Topic 

learning_grsql
Posting Yak Master

230 Posts

Posted - 2011-07-11 : 16:21:45
I have a data with item purchased during the month. Now I want to find out total purchase for each item during the month along with each date.
The table is like this
Tomato >> 01.07.2011 >> 50
Potato >> 01.07.2011 >> 30
Onion >> 02.07.2011 >> 50
Tomato >> 02.07.2011 >> 30
Mango >> 03.07.2011 >> 30
Tomato >> 03.07.2011 >> 80

Output should be like this
Tomato >> 1.07.2011 >> 50 (qty)
>> 02.07.2011 >> 30
>> 03.07.2011 >> 80 and etc.
Total for July >> 160
Similarly for potato, onion, mango and etc.

Could you please tell me sql codes for this?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-07-11 : 16:25:32
That's a display issue and you should do that in your front end.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -