top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to Update a Table using Join?

0 votes
243 views
How to Update a Table using Join?
posted Jul 17, 2014 by Amritpal Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Joins are used in SQL, where we want to fetch the records from two tables.

You can update via Join using following query.
UPDATE employee e LEFT JOIN employee_salary s ON e.id=s.employee_id
SET s.salary='50000'
where e.first_name='Admin';

answer Jul 18, 2014 by Rahul Mahajan
Similar Questions
+1 vote

Do i need to write in PL/SQL or is it possible in SQL query?

+2 votes

I want to update data from one table to another table with year condition.
(OR)
To Update one table based on another table using INNER JOIN

+3 votes

This is the Sales_Import table, where the account number field needs to be updated:
LeadID AccountNumber

147 ********** 
150 ********** 
185 7006100100007267039

And this is the RetrieveAccountNumber table, where I need to update from:
LeadID AccountNumber

147 7006100100007266957 
150 7006100100007267039 
...