SqlServer INSERT INTO SELECT FROM

--INSERT INTO SELECT FROM
INSERT INTO BoxInfo(BoxNo,ItemNo,ItemNoOld,ItemName,ItemSpec)
SELECT A.BoxNo,A.ItemNo,B.ItemNoOld,A.ItemName,A.ItemSpec
FROM BoxTrans A,BasItemInfo B
WHERE A.ItemNo=B.ItemNo
AND A.BoxNo NOT IN (SELECT BoxNo FROM BoxInfo)
AND A.BoxNo<>''

 

posted @ 2021-03-12 12:27  Super元素  阅读(986)  评论(0编辑  收藏  举报