---
title: "通过update 恢复数据"
author: "foolraty"
date: "2010-08-13T15:44:08Z"
tags: []
categories: ["数据库"]
slug: "update"
draft: false
lastmod: "2010-08-13T15:45:41Z"
id: 736768
url: "https://foolraty.iteye.com/blog/736768"
---

update bildtl a  
 set a.price =    
 (select ci.price/i.untnum  
  from item i,corpitem ci  
  where a.biltyp='SX'  
  and a.dat = to\_date('2000-08-13','YYYY-MM-DD')  
  and a.corpid in (select id from corp where refid = 'KA049')  
  and nvl(a.refid1,'1') = '1')  
  and a.itmid = i.id  
  and i.guid = ci.item  
  and ci.corp = '7EAA86FB15F64431BA28ACAFDC98E3CB'  
 where   
  a.biltyp='SX'  
  and a.dat = to\_date('2000-08-13','YYYY-MM-DD')  
  and a.corpid in (select id from corp where refid = 'KA049')  
  and nvl(a.refid1,'1') = '1'