Skip to content
Advertisement

Using subquery with update SQL

I have Table 1 : EMP as below

Table 2: EMP1

ID is the Key and is common in both the files. I want an Update SQL to update the amount field of Table 1 using Amount field of table 2, which gives the result as below.

Result:

Advertisement

Answer

One method is a correlated subquery:

You can check if the values match using:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement