Solved

update with where and another select - doubt

Posted on 2012-04-04
2
261 Views
Last Modified: 2012-04-04
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
Comment
Question by:hidrau
2 Comments
 
LVL 23

Accepted Solution

by:
wdosanjos earned 500 total points
ID: 37806822
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
 
LVL 1

Author Closing Comment

by:hidrau
ID: 37807390
thanks very much
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now