sql语言怎么写(0分)

  • 主题发起人 主题发起人 kuaishang
  • 开始时间 开始时间
K

kuaishang

Unregistered / Unconfirmed
GUEST, unregistred user!
表A(已过账) <br>&nbsp; &nbsp; &nbsp; &nbsp;编码 &nbsp;出仓数量 &nbsp; 入仓数量<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 5 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;B &nbsp; &nbsp; &nbsp; 4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;C &nbsp; &nbsp; &nbsp; 7 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9<br><br>表B (未过账) <br>&nbsp; &nbsp; &nbsp; &nbsp;编码 &nbsp;出仓数量 &nbsp; 入仓数量<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp;8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;B &nbsp; &nbsp; &nbsp;9 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 6<br>写成C表(明细表)<br>&nbsp; &nbsp; &nbsp; &nbsp; 编码 &nbsp;出仓数量 &nbsp; 入仓数量<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 5 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;B &nbsp; &nbsp; &nbsp; 9 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;B &nbsp; &nbsp; &nbsp; 4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;C &nbsp; &nbsp; &nbsp; 7 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9<br>怎么写
 
select &nbsp;编码 , 出仓数量 &nbsp;, 入仓数量 from a <br>union all<br>select &nbsp;编码 , 出仓数量 , &nbsp;入仓数量 from b <br>order by 编码
 
非常谢谢
 
如果还有一个月结表:<br>表D (上月结存数量) <br>&nbsp; &nbsp; &nbsp; &nbsp;编码 &nbsp; &nbsp;上月结存 &nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; 55<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;B &nbsp; &nbsp; 88<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;C &nbsp; &nbsp; 66<br>写成C表(明细表)<br>&nbsp; &nbsp; &nbsp; &nbsp; 编码 &nbsp; &nbsp; 上月结存 &nbsp; 当前结存 &nbsp; &nbsp;出仓数量 &nbsp; 入仓数量<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; &nbsp; 55 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;54 &nbsp; &nbsp; &nbsp; &nbsp; 5 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4 &nbsp; //(已过账)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; &nbsp; 54 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;54 &nbsp; &nbsp; &nbsp; &nbsp; 8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3 &nbsp; //(未过账,当前结存不变<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;B &nbsp; &nbsp; &nbsp; &nbsp; 88 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;85 &nbsp; &nbsp; &nbsp; &nbsp; 9 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;B &nbsp; &nbsp; &nbsp; &nbsp; 85 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;85 &nbsp; &nbsp; &nbsp; &nbsp; 4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;C &nbsp; &nbsp; &nbsp; &nbsp; 66 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;63 &nbsp; &nbsp; &nbsp; &nbsp; 7 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9
 

Similar threads

回复
0
查看
1K
不得闲
S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
913
SUNSTONE的Delphi笔记
S
后退
顶部