Hey guys,
New to the site, new to writing SQL queries and have no background in this type of thing.
But I've been googling my way to victory for the most part.
I'm struggling on probably a very simple problem.
I'd like to Sum the contents of a column, if a different value in the row is the same as in another... That was worded horribly - how about an illustration:
Seq Unit ID Value
1 1 1000
2 1 100
3 11 300
4 11 1000
5 11 110
6 11 300
7 3 999
8 3 1
9 4 500
10 4 400
11 5 1200
12 6 1000
13 6 100
So basically I'm looking for an output when I run the script that shows
Value must >= 1000 after sum up with unit ID.Unit ID shown again if first value hit 1000
Seq Unit ID Value
1 1 1100 (1000+100)
2 11 1000
3 11 1100 (300+110+300)
4 3 1000 (999+1)
5 5 1200
6 6 1100
And various other simplistic queries, but at this point I'm willing to admit that I haven't a clue what I'm doing.
Any help would be appreciated,
Thanks!