Hi all, How do i do this in SQL? UPDATE table B set customernumber = customernumber table A WHERE (1st digit of customer number = 0,1,2,3 and maximum length = 10)? I've been messing around with substring and len but can't seem to get the results i want... Thanks!
What links table A and B? If it is just the customer number, then you will just be updating the value on B with the same value from A. Also the logic you have stated, is that for the customer number in A or B? I would use something like update B set B.customernumber = a.customernumber from tableB B join tableA A on B.somefield = A.somefield where left(1,B.customernumber) in (0,1,2,3) and len(B.customernumber)