1

起初我试过:

update myTable set myColumn = replace(myColumn,';','')

但是,数据可能在;数据中间具有有效值。前:

myColumn 
not;trailing
not;trailing and trailing; 
trailing;

后:

myColumn 
not;trailing
not;trailing and trailing
trailing
4

1 回答 1

2

您可以充分利用left(or substring),len在这种情况下:

update myTable
set myColumn = left(myColumn, len(myColumn) - 1)
where myColumn like '%;'
于 2013-10-31T15:28:32.527 回答