Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!mailrus!cornell!rochester!uhura.cc.rochester.edu!mpip From: mpip@uhura.cc.rochester.edu (Robert Annechiarico) Newsgroups: comp.databases Subject: replace in SQL Keywords: replace, SQL Message-ID: <226@ur-cc.UUCP> Date: 24 Oct 88 16:13:34 GMT Article-I.D.: ur-cc.226 Organization: Univ. of Rochester, Computing Center Lines: 34 Hi, We're migrating from quel to sql, and have had trouble figuring out how to update a relation when we want the values to come from a second relation. HELP! Please... Suppose that I have two relations, "result" and "new". Each has a key "id". The "result" relation has a second field named "score". The "new" relation has a second field named "test". 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? Related question: what sql tutorial would people recommend? I've got the Ingres SQL reference guide, and Date's A Guide to Ingres and An Introduction to Database System; none of them showed how to do the required update in sql. Thanks very much. Eric Carleen University of Rochester Medical Center (716)-275-5391 Bitnet: heartedc@uorhbv UUCP: {ames,cmcl2,decvax,rutgers}!rochester!ur-msbvax!ur-hbv!heartedc Internet: mpip@uhura.cc.rochester.edu "The large print giveth, and the small print taketh away". - Tom Waits