I have a Table, Table A, and in table A I have Field A. There are values in field A like the following:
Street A
Street B
,Street C
Street D
etc
I would like to know if there is any SQL that will allow me to either remove the 1st character from Field A where there is a ,.
I have know idea where to start I can select all the rows which have a , in Field A but I don't know where to start when trying to remove it.
If you'd rather not care about the length, STUFF is the right candidate :
UPDATE YourTable
SET YourCol = STUFF(YourCol, 1, 1, '')
WHERE YourCol LIKE ',%'
UPDATE YourTable
SET YourCol = SUBSTRING(YourCol, 2, 0+0x7fffffff)
WHERE YourCol LIKE ',%'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With