Transact SQL Combine Customer Records
Posted on 2011-09-20
Can someone please helpme with a SQL Update Query?
Occasionally I get duplicate customer records because they have setup a second account with their work email and forgot that they had originally setup their account with their home email.
I want to write a query that will essentially combine the 2 records and then delete 1 of them.
So, for example, I want to take record id #202 and record id #561 and combine 3 fields: TotalSpent, TotalNumberof Orders, and logincount and write the totals into record id #561. Then, upon successful update, delete record id #202.
Any help will be appreciated.