You will come across the problem to update a table with the help of joining two tables.
Below is the steps to update a table using joins
- Perform a update say UPDATE
- Join the tables with condition say FIRSTTABLE AS A INNER JOIN SECONDTABLE AS B ON A.FIELDNAME = B.FIELDNAME
- Write the condition which is going to change or update say SET A.FIELDNAME=2, B.FIELDNAME=5
- If you have a where condition then add it say WHERE A.FIELDNAME=10
UPDATE
FIRSTTABLE AS A INNER JOIN SECONDTABLE AS B
ON A.FIELDNAME = B.FIELDNAME
SET A.FIELDNAME=2, B.FIELDNAME=5
WHERE A.FIELDNAME=10
Simply cool
Hope this helped you.
Happy Coding,
Kumar
0 Comments:
Post a Comment