Using SQL I need the correct syntax for updating one field with the contents of another field?
-
Example: Productcode /Desc. / Ischildofproductcode MP001/ X / Tx003 / / MP001 I need to take the value from the field “Desc.” In the MP001 record and give that value to the field “desc.” In the TX003 record using the “ischildofproductcode” field to make the comparison. **Please note, I need to do this on a large scale for about 40k records, I will be using MS Access.
-
Answer:
Hmm... I am not sure about the naming you're using, but I will try: UPDATE TX003 set TX003.Desc = (select MP001.Desc from MP001 where TX003 .Ischildofproductcode= MP001.Ischildofproductcode)
yoursola... at Yahoo! Answers Visit the source
Other answers
2 points... MS-Access? I thought you said large scale. Try updating 900 million records. Most of the people responding are pretty close, you'll get it. Oh by the way, back up your "large" database until you get it right.
i wear one button suit
Update <table> Set Tx003 = desc Where Productcode = lschiidofproductcode Helmut
hswes
update (tablename) set desc = (select distinct desc from (tablename) b where b.productcode=a.ischildofproduct) where desc=NULL something like that maybe?
bobseveneleven
I believe this will work although I am not sure about the access's support for sub-queries. ** Do a test run first! and backup your DB ** UPDATE products SET Desc = ( SELECT products2.Desc FROM products products2 WHERE products2.Productcode = products.Ischildofproductcode )
Tenar2
Related Q & A:
- How do I transfer my e-mail contacts from one account to another?Best solution by Yahoo! Answers
- How do i correct syntax error?Best solution by Yahoo! Answers
- What do I need to study in college to go into the field of International marketing?Best solution by Yahoo! Answers
- I need a job in summer and no one is hiring what do I do.Best solution by snagajob.com
- I need help deciding on a major in the medical field.Best solution by mymajors.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.