DECLARE
v_count pls_integer;
BEGIN
select count(*) into v_count
from
(
select * from tb1 where
minus
select * from tb2 where ...
);
if v_count=0 then
dbms_output.put_line ('2条数据完全相等');
else
dbms_output.put_line ('2条数据不完全相等');
end if
END;
利用minus语法。
v_count number;
select count(*) into v_count from(
select * from tbl1 where ***
minus
select * from tbl2 where ****
)
if v_count=0 then
相同
else
不相同
end if;