阅读背景:

SQL Server中的SUM,在JOIN的一侧有多行,另一侧在另一侧作为比较

来源:互联网 

I have a situation I am trying to find out. I am trying to compare two sets of data on the qty at a size level. It seems simple enough but the issue is in some cases the qty can be split out on two lines on one side of the equation thus I would have two lines of 250 comparing to one line of 500. They are equal in total but the query I am writing doesn't seem to work. I have posted the query below with some output. In the first result material D68154 size L has two lines on the "M" side of the query totaling 500 and one line on the "A" side of the query totaling 500. In my ideal case this result wouldn't come back as I wan't to compare only where the sums are actually different. Any ideas? Thanks. I have a situation I am trying to find out. I a




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: