Solved

update with where and another select - doubt

Posted on 2012-04-04
2
258 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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

20 Experts available now in Live!

Get 1:1 Help Now