0

I have a table named as data1 with two columns (Name, address) and an another table named as data2 with same columns

My question: How to assign the value as 'USA' to address column where the value in name columns are equal in both the tables.

5
  • 1
    What's wrong with UPDATE? Commented Jun 15, 2013 at 10:24
  • @IgnacioVazquez-Abrams would you please write me the command with update? Commented Jun 15, 2013 at 10:25
  • @user2058811, what have you tried? Commented Jun 15, 2013 at 10:25
  • @theghostofc I have tried the below query Commented Jun 15, 2013 at 10:36
  • UPDATE data1 SET data1.address = 'USA' WHERE data1.name=data2.name Commented Jun 15, 2013 at 10:36

1 Answer 1

1
UPDATE data2 SET
Address = 'USA'
WHERE Name IN (SELECT Name FROM data1)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.