473,409 Members | 1,945 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,409 software developers and data experts.

Proper SQL String

I'm a novice to mySQL. I am looking for help to develop a query that will add data to an existing tableA.

The query should check fieldA of tableA (also the PK)and check it against the fieldA (the same PK)in my dump. If they match, then my dump file would update fieldX, fieldY, and fieldZ on tableA from my dump fieldB, fieldC, fieldD.

If it is easier to do a column at a time that is acceptable.

How would you construct such a query?
Mar 27 '12 #1
2 1650
Rabbit
12,516 Expert Mod 8TB
You would use an update query where you join the tables together on the PK.
Mar 27 '12 #2
Luuk
1,047 Expert 1GB
more about the how to do the update is here, to join the tables you can find info here

after reading, and studying, you should get something like (intested)
Expand|Select|Wrap|Line Numbers
  1. UPDATE tableA A 
  2. INNER jOIN tableB B ON A.fieldA=B.fieldA 
  3.   SET A.fieldX=B.fieldB, 
  4.   A.fielY=B.fieldC, 
  5.   A.fieldZ=B.fieldD;
  6.  
Mar 27 '12 #3

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

Similar topics

4
by: Ken Fine | last post by:
No joy on Macromedia's boards after a few days; maybe someone can help me here. I got an excellent string handling function off of planet-source-code.com that converts text strings to proper...
3
by: m.ramana | last post by:
Given a string it should convert it to a proper text. Example: if you passed a string 'Cat in the hat', I want 'Cat In The Hat' Curious about few things, Does sql have Instr OR Split(like VB)...
0
by: Thor-Björn Andersson | last post by:
Hi Im using MSMQ to send and then read messages. I use a Formatter (http://support.microsoft.com/default.aspx?scid=kb;EN-US;310683), but I use "Encoding.Unicode" instead of "Encoding.UTF8". ...
2
by: mirek | last post by:
Hi, I'm trying to import my old code to the .NET using managed wrappers. I've read "Managed Extensions for C++ Migration Guide" document and was trying to do what it stated in it. For example if...
6
by: RNEELY | last post by:
I've inherited code similar to the following with a comment on resetting the string. Why would anyone want to do this? How could this reset the string? What does it mean to reset a string? ...
41
by: rick | last post by:
Why can't Python have a reverse() function/method like Ruby? Python: x = 'a_string' # Reverse the string print x Ruby: x = 'a_string' # Reverse the string
7
by: =?Utf-8?B?QnJpYW4gS3Vueg==?= | last post by:
Hello, I'm new to the boards, and I've been struggling with a problem porting my company's code from Visual C++ 6.0 to Visual C++ 2005. We've found some crashes that I've traced to the...
20
by: Xcriber51 | last post by:
Hi -- I'm not entirely familiar with the norms and standard libraries of JavaScript so if the answer to this is yesterday's news, please ignore. I'm trying to write a simple text formatting...
10
by: Roger Frost | last post by:
Since we are currently on the subject of multi-threading in a different thread, I have a question about delegates. When I use delegates, I just create one for each different parameter set that I...
21
by: Sami | last post by:
string = "" or string = string.Empty? should is the proper way? Sami
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.