insert into table1 select b. * from table2 b ,(select count(1) cnt from table1where num=00010 and rownum<2 )a where a. cnt=0;
請問這句sql是什么意思?
uj5u.com熱心網友回復:
從陳述句上來說:如果表 table1 中,不存在 num=00010 的記錄,就把 table2 中的資料,全量插入到 table1 中。
uj5u.com熱心網友回復:
換一個寫法,看看您能不能看懂。insert into table1 select b. * from table2 b where exists(select 0 cnt from table1 where num=00010) ;
uj5u.com熱心網友回復:
好像是not exists 。。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/36538.html
標籤:開發
