update AllPunishment a set (a.CreditID)=(select b.CreditID from CorporationMainTable b where b.CorporationName=a.CorporationName and b.OrganizationCode=a.OrganizationCode and rownum =1) where exists (select 1 from CorporationMainTable b where b.CreditID=a.CreditID)
转载于:https://www.cnblogs.com/xsmhero/archive/2011/04/06/2006671.html