update
restore_base 
set 
restore_base.localcost =(select   localcost  from 
  [nt2000\cpi].chongia2.dbo.restore_base   where prodnr =restore_base.prodnr   )
where restore_base.prodnr like '%-00'
and restore_base.scost <> 0
and restore_base.prodnr in(select  prodnr from  [nt2000\cpi].chongia2.dbo.restore_base)

restore_base.prodnr  对应的是被修的表。

prodnr 对应的是参照表。

参照表在前。

关于UPdate用法的的更多相关文章

  1. MyBatis从入门到精通:update用法、delete用法

    update用法: 1.接口类中添加的方法: int updateById(SysUser sysUser); 2.映射文件中添加的代码: <update id="updateById ...

  2. MyBatis从入门到精通(第2章):MyBatis XML方式的基本用法【insert用法、update用法、delete用法】

    2.4  insert 用法 2.4.1  简单的 insert方法 在接口 UserMapper.java 中添加如下方法. /** * 新增用户 * @param sysUser * @retur ...

  3. 批量插入或更新操作之ON DUPLICATE KEY UPDATE用法

    实际的开发过程中,可能会遇到这样的需求,先判断某一记录是否存在,如果不存在,添加记录,如果存在,则修改数据.在INSERT语句末尾指定ON DUPLICATE KEY UPDATE可以解决这类问题. ...

  4. JSF的CommandXxx组件的update用法总结

    Update all forms 1 update="@(form)" Update first form 1 update="@(form:first)" U ...

  5. ON DUPLICATE KEY UPDATE用法

    INSERT INTO `books ` (`name`,`count`,`num`) VALUES ('windows','1','2'),('','linux','1','3') ON DUPLI ...

  6. MySQL: ON DUPLICATE KEY UPDATE 用法 避免重复插入数据

    INSERT INTO osc_visit_stats(stat_date,type,id,view_count) VALUES (?,?,?,?) ON DUPLICATEKEY UPDATE vi ...

  7. 【MySql】update用法

    update 语句可用来修改表中的数据, 简单来说基本的使用形式为: update 表名称 set 列名称=新值 where 更新条件; 以下是在表 students 中的实例: 将 id 为 5 的 ...

  8. Oracle之with as和update用法

    许久不用,又忘了,做个记录 update test b set b.code=(with t as(select t.id,code||'_'||row_number() over(partition ...

  9. MySQL: ON DUPLICATE KEY UPDATE 用法

    使用该语法可在插入记录的时候先判断记录是否存在,如果不存在则插入,否则更新,很方便,无需执行两条SQL INSERT INTO osc_visit_stats(stat_date,type,id,vi ...

随机推荐

  1. UserControl调用Umbraco的Data Types

    本篇文章介绍的是基于Umbraco CMS技术搭建的网站所使用的相关技术. 1.  需求: 网站前台功能有个表单提交,表单控件用到下拉列表(dropdownlist),需求是在dropdownlist ...

  2. [Redux] Colocating Selectors with Reducers

    We will learn how to encapsulate the knowledge about the state shape in the reducer files, so that t ...

  3. Linux下设置最大文件打开数nofile及nr_open、file-max

    在开发运维的时候我们常常会遇到类似“Socket/File: Can’t open so many files”,“无法打开更多进程”,或是coredump过大等问题,这些都可以设置资源限制来解决.今 ...

  4. 节点类(CCNode)

    节点与渲染树 回顾前面的介绍,我们已经知道了精灵.层和场景如何构成一个游戏的框架.精灵属于层,层属于场景,玩家与精灵互动,并导致游戏画面在不同场景中切换.把每个环节拼接在一起,我们得到了一个完整的关系 ...

  5. GetTickCount() 函数的作用和用法

    今天项目中60秒倒计时模块需要用到GetTickCount(),这个函数,在此做下整理和总结. 1.定义 For Release configurations, this function retur ...

  6. Grant-Permission.ps1

    Grant-Permission.ps1 Download the EXE version of SetACL 3.0.6 for 32-bit and 64-bit Windows. Put set ...

  7. CentOS 6.7安装Tomcat 7

    1.下载Tomcat 7 wget http://apache.fayea.com/tomcat/tomcat-7/v7.0.67/bin/apache-tomcat-7.0.67.tar.gz 2. ...

  8. js--小结①

  9. log4net日志组件

    转载:http://www.cnblogs.com/knowledgesea/archive/2012/04/26/2471414.html 一.什么是log4net组件 Log4net是基于.net ...

  10. C#中堆和栈的区别分析(有待更新总结)

    转载:http://blog.csdn.net/zevin/article/details/5721495 一.预备知识-程序的内存分配 一个由C/C++编译的程序占用的内存分为以下几个部分 1.栈区 ...