asked on
ASKER
ASKER
UPDATE t1
SET t1.ProgramCode = t2.ProgramCode
FROM myloantable t1
INNER JOIN myloantable t2 on t2.Guid = t1.LinkGuid
WHERE t2.LienType = 'First Lien'
and t1.LienType = 'Second Lien'
and t1.ProgramCode = 'C30'
ASKER
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY
ASKER
Example:
Guid LinkGuid LoanNumber LienType ProgramCode
{f1244} {2077a} 123456789 First Lien Bond
{2077a} {f1244} 567345673 Second Lien C30
{4ertw} {w234r} 342342342 First Lien C15
{w234r} {4ertw} 567834566 Second Lien C30
Result
Guid LinkGuid LoanNumber LienType ProgramCode
{f1244} {2077a} 123456789 First Lien Bond
{2077a} {f1244} 567345673 Second Lien Bond <-- should change to 'Bond'
{4ertw} {w234r} 342342342 First Lien C15
{w234r} {4ertw} 567834566 Second Lien C30 <-- no change