ÓÐÁ½¸ö±íA±íºÍB±í
Ôõô°ÑA±íÖеÄÒ»Ðзŵ½B±íÖÐ
insert into b select cola ,colb ,colc from a where cola=***
insert into b (col1,col2,...,coln)
select col1,col2,...,coln from a
where ...;
commit;
×¢Òâ¶ÔÓ¦ÁÐÊý¾ÝÀàÐÍÓ¦¸ÃÒ»Ñù¡£
insert into b (id,code,name,...)
select id,code,name...from a
where id=?
insert into b (col1,col2,...,coln)
select col1,col2,...,coln from a
×¢ÒâÊý¾ÝÀàÐÍ
¿ÉÒÔexp µ¼³öÀ´£¬ÔÚimp µ¼Èë½øÈ¥¡£¡£¡£
insert into b (id,code,name,...)
select id,code,name...from a
where id=?
SQL code:
merge into B using A on(A.col1=B.col1)
when not matched then insert(B.col1,B.col2) values(A.col1,A.col2)
ÓÃunion¿ÉÒÔÂð£¿
ÎÒÓÐÒ»¸öserver 2000ÀïµÄÊý¾Ý,ÏÖÔÚÏëתµ½oracleÊý¾Ý¿âÉÏÓÃ,²»ÖªµÀÓÐûÓиßÊÖÓмòµ¥ÓÖ¿ì½ÝµÄ·½·¨,ǰÌáÊDz»ÄܸÄÔÀ´oracleÀïµÄÔÓеÄÊý¾Ý¿â,Ö»ÄÜн¨
ÒýÓÃ
°²×°£Ï£Ò£Á£Ã£Ì£ÅµÄ£Ï£Ä£Â£Ã£¬È»ºóÓãӣѣ̡¡£Ó£Å£Ò£Ö£Å£ ......