日期:2014-05-17 浏览次数:20501 次
color size qty
red xs 1
red s 2
red m 3
red l 4
red xl 5
red xxl 6
black xs 7
black s 8
black m 9
bule xs 10
bule s 11
bule m 12
bule l 13
bule xl 14
color size qty
red xs 1
red s 2
red m 3
black xs 7
black s 8
black m 9
color size qty
red xs 0
red s 0
red m 0
black xs 0
black s 0
black m 0
red l -4
red xl -5
red xxl -6
bule xs -10
bule s -11
bule m -12
bule l -13
bule xl -14
select a.color,
a.[size],
(isnull(b.qty,0)-a.qty) as qty
from a a left join b b
on a.color=b.color and a.size=b.size