update a table based on a query of itself
Posted on 2013-01-28
Good Afternoon Experts,
I have a table that is storing a name column as a full name and I want to split it up as first name and last name. The data is pretty clean, one space between first and last name in each case, no initals etc so I can do a select to seperate the data for example :
SUBSTRING(Loan_Officer, 1, CHARINDEX(' ', Loan_Officer) - 1) AS LO_First_Name,
SUBSTRING(Loan_Officer, CHARINDEX(' ', Loan_Officer) + 1, 8000) AS LO_Last_Name
but how do I then take that data and update Custom_LO_Commission table
to insert the two new columns LO_FirstName and LO_LastName with the correct data per record?