sql server - how to separate comma in SQL -
i data field:
maritalstatus=m;youngest=[-0.999,0.999];
split to:
field name = maritalstatus , data m field name = youngest , data [-0.999,0.999];
how write sql?
that's bit of fun substring
, charindex
it's doable 2 pieces of information extract:
select substring(@string, charindex('=', @string) + 1, charindex(';', @string) - charindex('=', @string) - 1) maritalstatus, substring(@string, charindex('=', @string, charindex(';', @string)) + 1, len(@string) - charindex('=', @string, charindex(';', @string))) youngest
Comments
Post a Comment