I needed to copy information from one row of a table to another. I noticed I could do the following:
update address set col1 = a2.col1, col2 = a2.col2, .....etc from address a1, address a2 where a1.id = @to and a2.id = @from
However, the above SQL seems kind of ambiguous.
How do I know it's going to update row @to with data of @from and not the otherway around?
Edit: Note: while I have not done extensive testing, this query does seem to work as I try it against our development database. It simply updates the one @to row with results from the @from row.