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.
| Author |
Topic |
|
jagganaveen
Starting Member
6 Posts |
Posted - 2007-08-28 : 05:22:54
|
| Hi Friends,I want codeing for to find (subtotal & total)the following Inputproductname qty_A_grade Qty_B_gradeabc 10 5def 5 5 subtotalgh 10 10ab 10 10 Total outputproductname qty_A_grade Qty_B_gradeabc 10 5def 5 5 subtotal 15 10 gh 10 10ab 10 10 Total 20 20 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-08-28 : 05:28:11
|
now that's question with a complete lack of info here's one way:print('ename salary')print('ravi 10')print('kiran 20')print('raj 10')print('subtotal 40')print('raju 10')print('shiva 20')print('Total 30')_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2007-08-28 : 05:31:09
|
| I want to win the lottery as well.....and given the amount of into you have posted to describe your problem, I don't know which one of us will hit the jackpot first.I wonder do college terms start early these days.....looks like "SQL 101" might be starting again. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-08-28 : 05:31:51
|
quote: Originally posted by jagganaveen Hi Friends,I want sample codeing for the following ename salaryravi 10kiran 20raj 10subtotal 40raju 10shiva 20Total 30
Where do you want to show the data?MadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-08-28 : 06:03:27
|
quote: Originally posted by jagganaveen Hi Friends,I want codeing for to find (subtotal & total)the following Inputproductname qty_A_grade Qty_B_gradeabc 10 5def 5 5 subtotalgh 10 10ab 10 10 Total outputproductname qty_A_grade Qty_B_gradeabc 10 5def 5 5 subtotal 15 10 gh 10 10ab 10 10 Total 20 20
How are you dividing subtotal and total group data?MadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-08-28 : 08:18:36
|
| Well if you dont use front end, then read about ROLLUP Operator in sql server help fileMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|