473,382 Members | 1,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Simple update Table query based on 2 tables joined

Hi,

Please can you assist me, I'm trying to execute some SQL to update 1 column to a constant value (50) in multiple rows in Table A based on an associated 'SOURCE' value in table B

Table A joins to Table B based on the TableA.definition_id = TableB.Att_Def_id

like..

update TableA
set value =50
where
TableA.definition_id = TableB.Att_Def_id
and TABLEB.Source = 'NEWPRODUCT'

Any help would be appreciated.

Thanks
Dave
Nov 4 '08 #1
4 6561
debasisdas
8,127 Expert 4TB
Are You Facing Any Problem With That Code ?
Nov 4 '08 #2
Pilgrim333
127 100+
Hi,

Take a look at this page:

Update syntax

Especially the part about "Update based on a single queried value" an "Update based on a query returning multiple values" Try to make the query, if you are having problems with it, post your problems here.

Pilgrim.
Nov 4 '08 #3
Well I was at the time, but I have now resolved whatever problems I had by using the..

.... where TabeA.definition_id in (Select attribute_definition_id from tableB....

statement.

Thanks for taking the time to respond.

Dave
Nov 4 '08 #4
Pilgrim333
127 100+
Sweet.

Thanx for taking the time to share your solution.

Pilgrim.
Nov 4 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: sqlgoogle | last post by:
Hi I'm having update problem. Here is the senario I have to different db server (SQL Server) linked with each other In DB Server 1 I have 2 tables & In DB Server 2 I have 3 tables. I have...
17
by: kalamos | last post by:
This statement fails update ded_temp a set a.balance = (select sum(b.ln_amt) from ded_temp b where a.cust_no = b.cust_no and a.ded_type_cd = b.ded_type_cd and a.chk_no = b.chk_no group by...
2
by: Mike Leahy | last post by:
Hello all, This question is related to updating tables - is there any way to calculate or update the values in a column in a table to the values in a field produced by a query result? An...
4
by: John Baker | last post by:
Hi: I have two tables, a setup table (TblSetup) and a purchase order table (tblPO). When i construct a query with ONLY the tblPO shown, and a type in parameter for the PO number, I an update...
2
by: dskillingstad | last post by:
I would really appreciate someone's help on this, or at least point me in the right direction.... I'm working on a permit database that contains 12 tables, and rather than list all of the...
2
by: NigelMThomas | last post by:
I have an especially challenging problem. I know there are a few geniuses in this group so perhaps; you can advise me whether or not this can be done as an update query in Access. Thanks. I am...
1
by: Foef | last post by:
When I have a stored procedure, with multiple tables in MS Access, in a dataset and I change it in my DataGrid, I get the next message when I want to update my DataSet: ...
2
by: Fendi Baba | last post by:
I created a person table with various fields such as Suffix, Salutation, etc, Some of these fields may not be mandatory for example suffix. In the actual table itself, I only have a field for...
1
by: racquetballer | last post by:
I need to to an update query that involves three tables: table Dealer needs to be updated with data from table Personnel and table Title. Dealer is joined to Personnel where Dealer.Dealer_Code =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.