select 日期,编码,名称,单位,期初数量,0 as 入库数量,0 as 出库数量,0 as 转入数量,0 as 转出数量,0 as 内销数量,0 as 退运数量,期初金额,0 as 入库金额,0 as 出库金额,0 as 转入金额,0 as 转出金额,0 as 内销金额,0 as 退运金额 from [期初$] union all
select 日期,编码,名称,单位,0,入库数量,0,0,0,0,0,0,入库金额,0,0,0,0,0 from [入库$] union all
select 日期,编码,名称,单位,0,0,出库数量,0,0,0,0,0,0,出库金额,0,0,0,0 from [出库$] union all
select 日期,编码,名称,单位,0,0,出库数量,0,0,0,0,0,0,出库金额,0,0,0,0 from [出库2$] union all
select 日期,编码,名称,单位,0,0,0,转入数量,0,0,0,0,0,0,转入金额,0,0,0 from [转入$] union all
select 日期,编码,名称,单位,0,0,0,0,转出数量,0,0,0,0,0,0,转出金额,0,0 from [转出$] union all
select 日期,编码,名称,单位,0,0,0,0,0,内销数量,0,0,0,0,0,0,内销金额,0 from [内销$] union all
select 日期,编码,名称,单位,0,0,0,0,0,0,退运数量,0,0,0,0,0,0,退运金额 from [退运$]
截图就免了吧?楼主可以对照第一行语句,后续的0 as字段部分都可以0值代替,以简化语句。
[ 本帖最后由 抹香鲸2009 于 2010-5-29 12:33 编辑 ] |