我执行以下代码row_count=0
declare
row_count number;
END_DATE DATE; --进出数量累计计算结束时间
begin
END_DATE := SYSDATE;
row_count := 0;
select count(*)
into row_count where passdate < end_date
from table ;
end;
我执行以下代码row_count > 0
declare
row_count number;
begin
row_count := 0;
select count(*)
into row_count where passdate < SYSDATE
from table ;
end;
两者区别是什么? ------解决方案-------------------- 先 SET SERVEROUTPUT ON
然后
declare
row_count number;
END_DATE DATE;
begin
END_DATE := SYSDATE;
row_count := 0;
select count(*)
into row_count
from sapdt_wakh where logdate < end_date;
dbms_output.put_line('this is the count:' ------解决方案-------------------- to_char(row_count));
end; ------解决方案--------------------