sql server - cleaning CSV String/varchar in SQL -
i've got quirks in varchar field designated used csv (comma separated values) i'd clean up.
for example comma: val1, ,val2, val3
or trailing comma val1, val2,
how craft sql replaces , ,
,
, removes last character if ,
?
select replace(columnname, ', ,', ', ') tablename
this may not work when have multiple spaces between comma.
Comments
Post a Comment