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 |
cronid
Starting Member
26 Posts |
Posted - 2006-10-03 : 11:15:39
|
I’ve got a table of cusips and account holdings where I only want to display the cusips whose holdings’ sum does not equal 0. It’s the fourth cusip in the example below. Do you have an idea about how to code the sql?Cusip holding 00080S101000 -7100080S101000 20000080S101000 -10000080S101000 -2900104Q107000 960500104Q107000 -9605001204106000 100001204106000 131001204106000 -23100163T109000 -21400163T109000 114 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-10-03 : 11:21:44
|
Can you some sample data?MadhivananFailing to plan is Planning to fail |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-10-03 : 11:22:11
|
Like this??Select CUSIPFrom TblGroup by CUSIPhaving sum(holding) <> 0 Harsh AthalyeIndia."Nothing is Impossible" |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-10-03 : 11:22:21
|
[code]select Cusipfrom tablegroup by Cusiphaving sum(holding) <> 0[/code] KH |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-10-03 : 11:22:52
|
x 2 KH |
|
|
|
|
|