表a : 表b:
Id name int_rate id name int_rate1 int_rate2 int_rate3
1 rose 37 1 rose 37 34 38
2 rose 34 2 john 35 45 55
3 rose 38
1 john 35
2 john 45
3 john 55
利用pl/sql程序块把表a变成表b?表
Id salary name
1 4500 rose创建存储过程,输入员工薪水范围,返回员工工号、姓名、薪水结果集。结果集按薪水升序排列
创建函数更新员工薪水,低于2000,且姓王的员工加5%,其他不变,更新成功返回0,否则返回1;
Id name int_rate id name int_rate1 int_rate2 int_rate3
1 rose 37 1 rose 37 34 38
2 rose 34 2 john 35 45 55
3 rose 38
1 john 35
2 john 45
3 john 55
利用pl/sql程序块把表a变成表b?表
Id salary name
1 4500 rose创建存储过程,输入员工薪水范围,返回员工工号、姓名、薪水结果集。结果集按薪水升序排列
创建函数更新员工薪水,低于2000,且姓王的员工加5%,其他不变,更新成功返回0,否则返回1;
解决方案 »
- 关于数据库访问情况统计的问题
- 我在oracle新建的库中导入了表,但是在pl/sql中查看的时候却看到的都是系统的表,删除的时候出现递归错误,为什么?
- windows 无法访问 虚拟机(linux)
- 请大家看看这个 Oracle 死锁是怎么造成的?
- SSL_ALG_CLIENT_AUTH_MODE_RSA_SIGN_SERVERSIDE_BS
- 对记录进行去重操作怎么写??
- varchar2出现空格,请问是怎么回事?
- oracle 9i中如何建立一个连接字符串(高分)
- 我的机器上装了oracle8.17,现在平时不怎么用了,但每次开机时oracle.exe这个进程还是会自动启动,我想让它不在在开机时自动运行该怎么办?
- 请推荐你认为最好的两本oracle教材及两本oracle参考资料,请不要多推荐
- oracle 存储过程及游标问题 (过程调过程) !!!
- Oracle存储过程参数保存在哪张系统表里?
sum(case id when 1 then int_rate else 0 end) int_rate1,
sum(case id when 2 then int_rate else 0 end) int_rate2,
sum(case id when 3 then int_rate else 0 end) int_rate3
from a group by name;create or replace test return number as
begin
update table set 薪水=薪水*(1+0.05) where 姓='王' and 薪水<2000;
return 0;
exception
when others then
return 1;
end;
create or replace test1(val1 in number,val2 in number)
v_id number;
v_name varchar2(10);
v_salary number;
as
cursor v_cur is select id,name,salary from table where salary<=val2 and salary>=val1 order by salary;
begin
open v_cur;
fetch v_cur into v_id,v_name,v_salary;
while v_cur %found loop
dbms_output.put_line(v_id||chr(9)||v_name||chr(9)||v_salary);
fetch v_cur into v_id,v_name,v_salary;
end loop;
close v_cur;
end;
begin
update table set salary=salary*(1+0.05) where name like '王%' and salary<2000;
commit;
return 0;
exception
when others then
return 1;
end;
sum(case Id when 1 then int_rate else 0 end)int_rate1,
sum(case Id when 1 then int_rate else 0 end)int_rate2,
sum(case Id when 1 then int_rate else 0 end)int_rate3,
from a group by name