update set from where

update t1  set age=t2.age,name=t2.name from t2 where t1.id=t2.id;
update t_company_info
set score = b.score,
tech_score = b.tech_score,
project_score = b.project_score,
service_score = b.service_score,
product_score = b.product_score,
efficiency_score = b.efficiency_score,
evaluate_no = a.evaluate_no + 1
from t_company_info a inner join
(select c.company_id,
avg(c.score) as score,
avg(c.tech_score) as tech_score,
avg(c.project_score) as project_score,
avg(c.service_score) as service_score,
avg(c.product_score) as product_score,
avg(c.efficiency_score) as efficiency_score
from t_evaluate_company c
group by c.company_id
)b
on a.id = b.company_id
and a.id =1;

转载于:https://www.cnblogs.com/esther-qing/p/6273554.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值