oracle 中分类和更新
答案:1 悬赏:40 手机版
解决时间 2021-02-06 01:36
- 提问者网友:寂寞撕碎了回忆
- 2021-02-05 00:55
oracle 中分类和更新
最佳答案
- 五星知识达人网友:迟山
- 2021-02-05 01:30
create or replace procedure p_test is
i_sum number(8);
begin
select count(*) into i_sum from cus;
update (select * from cus order by FCC_EVA_TOTAL desc) t set t.FCC_CUST_CLASSFIED_ID = '111' where t.FCC_EVA_TOTAL >= ceil(i_sum*0.8);
update (select * from cus order by FCC_EVA_TOTAL desc) t set t.FCC_CUST_CLASSFIED_ID = '112' where t.FCC_EVA_TOTAL <= floor(i_sum*0.8) and t.FCC_EVA_TOTAL >= ceil(i_sum*0.2);
update (select * from cus order by FCC_EVA_TOTAL desc) t set t.FCC_CUST_CLASSFIED_ID = '113' where t.FCC_EVA_TOTAL <= floor(i_sum*0.2);
commit;
end p_test;
i_sum number(8);
begin
select count(*) into i_sum from cus;
update (select * from cus order by FCC_EVA_TOTAL desc) t set t.FCC_CUST_CLASSFIED_ID = '111' where t.FCC_EVA_TOTAL >= ceil(i_sum*0.8);
update (select * from cus order by FCC_EVA_TOTAL desc) t set t.FCC_CUST_CLASSFIED_ID = '112' where t.FCC_EVA_TOTAL <= floor(i_sum*0.8) and t.FCC_EVA_TOTAL >= ceil(i_sum*0.2);
update (select * from cus order by FCC_EVA_TOTAL desc) t set t.FCC_CUST_CLASSFIED_ID = '113' where t.FCC_EVA_TOTAL <= floor(i_sum*0.2);
commit;
end p_test;
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯