Created
December 7, 2011 20:59
-
-
Save rrguntaka/1444622 to your computer and use it in GitHub Desktop.
Update with Select (Oracle). This query is to update a set of columns with the data from a subselect by matching id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE table_to_be_updated t1 | |
SET (t1.col1, t1.col2) = | |
(SELECT (t2.col1, t2.col2) subquery_or_table t2 | |
WHERE(t2.id1, t2.id2) in (t1.id1,t1.id2)) | |
WHERE (t1.id1, t1.id2) IN | |
(select t2.id1, t2.id2 from subquery_or_table t2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment