惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
腾讯CDC
IT之家
IT之家
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
U
Unit 42
爱范儿
爱范儿
博客园 - 聂微东
F
Fortinet All Blogs
V
Visual Studio Blog
Blog — PlanetScale
Blog — PlanetScale
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
L
LangChain Blog
雷峰网
雷峰网
B
Blog RSS Feed
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Engineering at Meta
Engineering at Meta
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - 老狐狸

关于Update语句在不同数据库中的差别 出错存储过程 F_GETTABLELID 正则表达式求值 - 老狐狸 - 博客园 创建层次查询 ultrawebgrid - 老狐狸 - 博客园 javascript - 老狐狸 - 博客园 case when用法和and 后加条件 exp/imp导出导入工具的使用 ASP.NET1.1中Grid自定义眉头 asp.net1.0 TreeView asp.net2.0 TreeView 创建记录、数组 关闭远程数据库连接 创建游标 创建新的序列 创建隐式游标 创建临时表
更新表(多表相关联)
老狐狸 · 2006-06-16 · via 博客园 - 老狐狸

update f_shortforest forest
   
set forest.forestquantity = (select (decode(sum(detail.quantity),
                                               
null,
                                               
0,
                                               
sum(detail.quantity)) * 0.6 +
                                       decode(forest.forestquantity,
                                               
null,
                                               
0,
                                               forest.forestquantity) 
* 0.4)
                                  
FROM d_salerplan@tpo       master,
                                       d_salerplandetail
@tpo detail
                                 
where master.sorderid = detail.sorderid
                                   
and forest.estimateyear =
                                       substr(master.ordermonth, 
14)
                                   
and forest.month =
                                       substr(master.ordermonth, 
52)
                                   
and forest.productid = detail.productid
                                 
group by detail.productid)
where exists(select detail.quantity
                                  
FROM d_salerplan@tpo       master,
                                       d_salerplandetail
@tpo detail
                                 
where master.sorderid = detail.sorderid
                                   
and forest.estimateyear =
                                       substr(master.ordermonth, 
14)
                                   
and forest.month =
                                       substr(master.ordermonth, 
52)
                                   
and forest.productid = detail.productid);