是这意思么?insert into B (hincd,col1,col2...)
select hincd,col1,col2...
from A where hincd not in(select distinct hincd from B)
select hincd,col1,col2...
from A where hincd not in(select distinct hincd from B)
解决方案 »
- “同义词为分布式数据库提供位置透明性”这句话什么意思
- 怎么在一个有(+)的sql里,再关联另1个表里的数据
- 深入挖掘oracle
- 如何列出oracle表查询出来的第5到第10条数据?sql应该在恩美写?
- PL/SQL 登陆错误
- 超级头疼,用jdbc:oracle:thin的方式连接oracle,数据库编码WE8DEC,本地nls_lang=WE8DEC,取出来始终是乱码!!
- 高分征求Database Link+job解决例子
- 请问oracle中的函数语法中的is/as有区别吗?
- SOS!VB下如何从过程里返回一个NULL的记录集!!!
- 两个oracle表数据统计汇总
- oracle从文件导入数据时出现1950错误如何解决
- SQL别名的问题
(
sp_skssb in number ,
sp_sksssy in varchar2
)return number as
--initday number(8) := to_number(to_char(sysdate, 'yyyymmdd'));
begin if exists(select * from hin_mst where hincd not in(select hincd from k_hin_mst)) then
begin
insert into k_hin_mst(hincd,skssb,sksssy)
select hincd,sp_skssb,sp_sksssy
from hin_mst
where hincd not in(select hincd from k_hin_mst); end;
end if end;
这样却不行,不知道怎么改了,大家帮帮忙
(
sp_skssb in number ,
sp_sksssy in varchar2
)return number as
v_num number;
begin
select count(*) into v_num from hin_mst where hincd not in(select hincd from k_hin_mst);
if v_num>0 then
begin
insert into k_hin_mst(hincd,skssb,sksssy)
select hincd,sp_skssb,sp_sksssy
from hin_mst
where hincd not in(select hincd from k_hin_mst); end;
end if end;
select count(*) into v_num
from hin_mst where hincd not exitsts(select 1 from k_hin_mst where k_hin_mst.hincd=hin_mst.hincd);没有其他的办法了
Using a
On (b.hincd= a.hincd)
When Matched Then
...
When Not Matched Then
Insert
(b.column....)
Values
(a.column....)