PL⼀SQL。。 用一个过程将表emp1中的数据插入到emp2中。

2025-03-24 04:11:23
推荐回答(2个)
回答1:

insert into emp2 (empno,ename,job,sal,comm,deptno,flag,loc,hiredate)
select a.empno,a.ename,a.job,a.sal,
case when a.comm between 0 and 1000 then comm+100 end
case when comm>1000 and comm<2000 then comm+200 end
case when comm>=2000 then comm+300 end,
a.deptno,b.flag,b.loc,a.hiredate from emp1
where a,dept1 b where a.deptno=b.deptno;

貌似也用不着存储过程,前边直接加个begin,后边加个end就是存储过程了

回答2:

··@··