How to access the value of a field of the current node in Drupal?

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

Was this solution helpful to you?

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

Just Added Q & A:

Find solution

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.