Suppose table 1 Have 1,000,000 rows. In table 2 there are 50,000 rows
INPUT
Table 1
Id User InternetAmountDue
1 joe NULL
Table 2
InternetUserId UserName AmountDue
21 kay 21.00
10091 joe 21.00
I want to merge data from table 2 to table 1 as follows:
- If user exists in Table 1, update InternetAmountDue Column
- Else, insert new user
OUTPUT
Table 1
Id User InternetAmountDue
1 joe 21.00
2 kay 21.00
How can this be done fast given the large volume of data involved?