I have a table with columns A,B,C.My requirement is to concatenate the values of columns A and B, and save it into column C. Note: All columns are of Varchar datatype.
For e.g:
If A = 100 and B = 200, C should be 100200
If A = 0 and B = 200, C should be 0200
If A = NULL AND B = NULL, C should be NULL
If A = NULL and B = 01, C should be 01
If A = 01 and B = NULL, C should be 01
Any ideas how this can be achieved using SQL?If only one of the column values is NULL, result should not be NULL.
What I have so far is:
select A+B C from myTable;