create or replace function emp_count(v_deptno number)
return number
is
v_count number;
begin
select count(*) into v_count from emp
where deptno = v_deptno;
return v_count;
end;
你这个返回的是一个表;
你要创建的函数应该是要返回一个值对吧(标量函数)
写的时候要改成
select v_count=count(*) from emp
where deptno = v_deptno;