oracle 和sqlserver的update语句区别

介绍:sqlserver的update语句updateesetscore=score1fromPERF_DEPT_KPIeleftjoin(selectscorescore1,SUPPER_WEIDU_IDfrom(SELECTSUM(PDK.score)score,pdk.grade,PD.SUPPER_WEIDU_IDF

介绍:sqlserver的update语句updateesetscore=score1fromPERF_DEPT_KPIeleftjoin(selectscorescore1,SUPPER_WEIDU_IDfrom(SELECTSUM(PDK.score)score,pdk.grade,PD.SUPPER_WEIDU_IDF。

oracle 和sqlserver的update语句区别


sqlserver的update语句

update e set score = score1 from PERF_DEPT_KPI e
left join (select score score1,SUPPER_WEIDU_ID from(
SELECT SUM (PDK.score) score,pdk.grade,PD.SUPPER_WEIDU_ID
FROM PERF_DEPT_KPI PDK
LEFT JOIN PERF_DIMENSION PD ON PDK.WEIDU_ID = PD.WEIDU_ID
WHERE PD.IS_ADD = 1 AND PDK.GRADE = 2 AND PDK.PROJECT_ID =29
GROUP BY PD.SUPPER_WEIDU_ID,pdk.grade) a)b
on e.weidu_id = b.SUPPER_WEIDU_ID
where e.grade=1 and e.weidu_id in(select DISTINCT SUPPER_WEIDU_ID from PERF_DIMENSION c where c.is_add =1 and project_id =29)

oracle 的 update语句

update PERF_DEPT_KPI a 
set score = (select score from (
select sum(PDK.score) score,PD.SUPPER_WEIDU_ID 
from PERF_DEPT_KPI PDK 
LEFT JOIN PERF_DIMENSION PD on PDK.WEIDU_ID= PD.WEIDU_ID
where PD.IS_ADD=1 and PDK.PROJECT_ID=58095 and PDK.GRADE=2
group by PD.SUPPER_WEIDU_ID,pdk.grade ) b where a.WEIDU_ID= b.SUPPER_WEIDU_ID and a.grade=1 ) 
where a.grade=1 and a.weidu_id in(select DISTINCT SUPPER_WEIDU_ID from PERF_DIMENSION c where c.is_add =1 and project_id =58095)


总结

以上是为你收集整理的oracle 和sqlserver的update语句区别全部内容,希望文章能够帮你解决oracle 和sqlserver的update语句区别所遇到的程序开发问题。

0 条回复 A 作者 M 管理员
    所有的伟大,都源于一个勇敢的开始!
欢迎您,新朋友,感谢参与互动!欢迎您 {{author}},您在本站有{{commentsCount}}条评论