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 |
Joetaniarto00
Starting Member
12 Posts |
Posted - 2015-02-19 : 23:11:21
|
Hi all,I have data as below :ID Trans. ID2.Tr Begin in out left14010011 C016988 1300000 0 500000 130000014010011 C016999 5200000 3750000 550000 145000014010011 C017009 1300000 1000000 250000 30000014010011 C017034 2600000 2600000 0 0I want to make result only on record which has 1300000 value on begin value as the filter so result contain of :ID Trans. ID2.Tr Begin in out left14010011 C016988 1300000 0 500000 130000014010011 C017009 1300000 1000000 250000 300000and than I want to make final result as :ID Trans. Begin in out left14010011 1300000 1000000 750000 1600000please help..thanks |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2015-02-20 : 09:46:50
|
select [id trans.], [id2.tr], begin, sum(in) in, sum(out) out, sum(left) leftfrom tablewhere [begin] = 1300000group by [id trans.], [id2.tr], begin |
|
|
huangchen
Starting Member
37 Posts |
Posted - 2015-04-02 : 05:58:16
|
unspammed |
|
|
|
|
|