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 |
|
aoriju
Posting Yak Master
156 Posts |
Posted - 2009-10-22 : 08:44:59
|
| ID Name QTY Status====================================1 Test1 2.000 FALSE 2 Test2 2.000 FALSE 3 Test3 1.248 TRUE 4 Test4 1.818 TRUE 5 Test4 0.667 TRUE 6 Test5 0.667 TRUE I want to get Sum with Avoid duplicate value1 Test1 2.000 FALSE 2 Test2 2.000 FALSE 3 Test3 1.248 TRUE 4 Test4 2.481 TRUE 5 Test5 0.667 TRUE |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-10-22 : 08:50:38
|
| select sum(distinct QTY) from <table_name>Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-10-22 : 08:50:54
|
| select name,sum(qty) as qty,status from your_tablegroup by name,statusMadhivananFailing to plan is Planning to fail |
 |
|
|
aoriju
Posting Yak Master
156 Posts |
Posted - 2009-10-22 : 09:10:59
|
| Not Working |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-10-22 : 09:13:40
|
quote: Originally posted by aoriju Not Working
Which query?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|