SQL> set serveroutput on
SQL> declare
2 l_cnt number;
3 begin
4 select max(1)
5 into l_cnt
6 from emp
7 where rownum = 1;
8
9 if l_cnt is not null then
10 dbms_output.put_line('ok');
11 end if;
12 end;
13 /
ok
PL/SQL procedure successfully completed.
SQL>
1条答案
按热度按时间wsewodh21#
首先选择(即检查表中是否有内容),然后在
IF
: