求大神帮忙写个SQL语句啊 急用 谢谢

什么_帝 2014-01-03 04:50:07

表名叫T_MH_TARGET_SUM 根据year,month,把month为11的sum_ndmb的值赋给相同sum_object_id,month为12的
...全文
141 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
什么_帝 2014-01-03
  • 打赏
  • 举报
回复
谢谢大神 受教了 写出来了
_拙计 2014-01-03
  • 打赏
  • 举报
回复
merge into
什么_帝 2014-01-03
  • 打赏
  • 举报
回复
引用 1 楼 zlloct 的回复:
meger into T_MH_TARGET_SUM t2 using(select * from T_MH_TARGET_SUM  where t.month=11) t1 on (t1.sum_object_id=t2.sum_object_id and t2.month=12)
when matched then
update t2 set t2.sum_ndmb=t1.sum_ndmb;
执行说无效的SQL语句 报错在meger那
CT_LXL 2014-01-03
  • 打赏
  • 举报
回复
meger into T_MH_TARGET_SUM t2 using(select * from T_MH_TARGET_SUM  where t.month=11) t1 on (t1.sum_object_id=t2.sum_object_id and t2.month=12)
when matched then
update t2 set t2.sum_ndmb=t1.sum_ndmb;

17,086

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧