I have a table in SQL server with the following rows and columns (A-code, Desc, Length and B-code)
A-Code Desc Length B-Code
A100 Rural-3D 25 A100
A100 NULL 55 B100
** In the first row A-code = B-Code
** In the second A-code<> B-Code and Desc is NULL
What I want to do is update the Desc column of the second row (A-code<> B-Code) with the Desc value from the first row where the A-Code = B-Code
So that my final table result would be as follows
A-Code Desc Length B-Code
A100 Rural-3D 25 A100
A100 Rural-3D 55 B100
Please help .
Thanks
SqlFiddle