楼上给的帖子他是有C1字段做基础进行其它表的字段更新只要JOIN连接下就好了,但是我现在是需要在某几张表中的一些字段我已经相互之间连接的SELECT语句已经写的OK了,就说现在我们从A,B,C表中查询出字段(如:select 'N'+substring(a.OutId,5,9) out_id, a.SeqNo, a.PartId, b.PartModel, b.PartName, left(c.Name,1) UnitName, a.OutNum, a.UnitPrice, a.TotalPrices, a.Income, a.Cost, 0.17 Revence, a.Profit
from D_StoreOutList a
left join B_Part b on(a.PartId=b.PartId)
left join B_CommCode c on(c.ClassId='117' and b.MsUnit=c.Code)
where OutId in(select OutId from D_StoreOut WHERE StoreId like 'A%' and StoreAfmFlag='1' AND (StoreAfmTime>='2006-02-23' and StoreAfmTime<'2006-03-06'))
order by a.OutId, a.SeqNo;
),现在查询出来的数据把INSERT到D表中去,它不是对原有数据的更新而是添加!;)
而且A,B,C表是在不同的database下,A,B,C是在BTMIS,而D是在MIDDLEDATA中
[ 本帖最后由 ramson 于 2006-4-6 09:45 AM 编辑 ]