1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
1. 这条语句主要是用来修复一个表中的数据 , 在另一个统计表中没有统计时,进行修改统计表的操作<br> update
expert_count ec inner
join
(
select
sum (e.EFFECT_SCORE) es_count,
sum (e.ATTITUDE_SCORE) as_count,
sum (e.PROMOTE_REASONABLE_SCORE) pro_count,
sum (e.PRICE_REASONABLE_SCORE) pri_count,
sum (e.ENVIRONMENT_SCORE) env_count,
count (e.effect_score) count_sum,
expert_id
from
evaluation e group
by
expert_id ) count_result
on
ec.expert_id = count_result.expert_id
set
ec.received_evaluation_count = count_result.count_sum ,
ec.EFFECT_SCORE = count_result.es_count,
ec.ATTITUDE_SCORE = count_result.as_count,
ec.PROMOTE_REASONABLE_SCORE = count_result.pro_count,
ec.PRICE_REASONABLE_SCORE = count_result.pri_count,
ec.ENVIRONMENT_SCORE = count_result.env_count ;
|