Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!cod!dberg From: dberg@cod.NOSC.MIL (David I. Berg) Newsgroups: comp.databases Subject: Re: replace in SQL Keywords: replace, SQL Message-ID: <1272@cod.NOSC.MIL> Date: 24 Oct 88 20:01:42 GMT Article-I.D.: cod.1272 References: <226@ur-cc.UUCP> Organization: Naval Ocean Systems Center, San Diego Lines: 18 In article <226@ur-cc.UUCP>, mpip@uhura.cc.rochester.edu (Robert Annechiarico) writes: > > ..... I want to replace "score" in "result" with the value of "test" > from "new", wherever "id" matches. > > In quel I would do: > > replace result (score = new.test) > where result.id = new.id > > How do I do this in sql? > update result set score = (select test from new where new.id = score.id) -- David I. Berg (dberg@nosc.mil) GENISYS Information Systems, Inc., 4250 Pacific Hwy #118, San Diego, CA 92110 MILNET: dberg@nosc.mil UUCP: {akgua decvax dcdwest ucbvax}!sdcsvax!noscvax!dberg