sql语句做数据初始化(科创)

delete from td_project_integral where appraise_id='1';

--pk
create sequence SEQ_GYX10
minvalue 1000
maxvalue 9999
start with 1000
increment by 1
cache 20;

--cid
create sequence SEQ_GYX11
minvalue 1000
maxvalue 9999
start with 1000
increment by 1
cache 20;


--pkid
select '1'||to_char(sysdate,'yyyymmdd')||SEQ_GYX10.Nextval from dual;
--cid
select SEQ_GYX11.Nextval||'p1' from dual;

select * from td_project_integral;
  

insert into TD_PROJECT_INTEGRAL
select '1'||to_char(sysdate,'yyyymmdd')||SEQ_GYX10.Nextval pk_id,SEQ_GYX11.Nextval||'p1',
a.*,b.* from
(select project_id PROJECT_ID ,project_name PROJECT_NAME ,project_manager_name PROJECT_MANAGER_NAME,
project_manager_id PROJECT_MANAGER_ID
from td_phases_info where state='3' group by project_id,project_name,
project_manager_name,project_manager_id) a,
(select context_name CONTEXT_NAME,appraise_name APPRAISE_NAME,persent_score PERSENT_SCORE,
appraise_base_score APPRAISE_BASE_SCORE,appraise_way APPRAISE_WAY,integral_rule INTEGRAL_RULE,appraise_id APPRAISE_ID
from TD_INTEGRAL_PARAMETER where appraise_id='1') b;

commit;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值