How to do a replace between columns in SQL SERVER. For example, given the table below:
COLUNA_A | COLUNA B | COLUNA_C
A 123 casa
I tried to run the query:
SELECT REPLACE(COLUNA_C, COLUNA_A, COLUNA_B ) FROM TABELA
To try to get the result:
COLUNA_A | COLUNA B | COLUNA_C
A 123 c123s123
But it did not work. How can I make this replace using the values of the columns?
If you do this:
SELECT REPLACE(COLUNA_C, 'a', COLUNA_B ) FROM TABELA
works normally. Even I tried to cast or convert to COLUMA_A and COLUNA_B, inside the replace, also without success.