• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

update with where and another select - doubt

Hello Guys

I have a table with prod_code and supplier_code.

I want to update my main table only when my prod_code and supplier_code is found in my table B

I am having doubt to assemble this

update siaprod set pro_pven where exists (select * from table B)

my siaprod has two field that has in table B

how can I do this?

Thanks
0
hidrau
Asked:
hidrau
1 Solution
 
wdosanjosCommented:
Please try:
update siaprod
 set pro_pven = << value to update >>
from siaprod s
inner join tableB b on s.prod_code = b.prod_code and s.supplier_code = b.supplier_code

Open in new window

0
 
hidrauAuthor Commented:
thanks very much
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now