Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update query with Joins

512918Jun 28 2006 — edited Dec 8 2009
How to write a update query with joins?

something like this
UPDATE TBL_BASE_TO_PEOPLE2
SET TBL_BASE_TO_PEOPLE2.BASE_CODE = TBL_BASES.BASE_CODE
FROM TBL_BASE_TO_PEOPLE2, TBL_BASES
WHERE SUBSTR(TBL_BASE_TO_PEOPLE2.BASE_CODE, 1, 6) = SUBSTR(TBL_BASES.BASE_CODE, 1, 6)

Hope this kind of query works in other databases like mysql, sybase. What is the equivalent syntax for the above?

I tried to use this query. But the subquery returns more than 1 row. Cant i update the above requirement in a single query. Help me.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 5 2010
Added on Jun 28 2006
11 comments
124,610 views