Update query with Joins
512918Jun 28 2006 — edited Dec 8 2009How 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.