I want to change the format from r1 to r2 Using SQL Server
r1 :[ [ [ 1, 1 ], [ 2, 2 ], [ 3, 3 ],[ 4, 4 ] ] ]
r2 (should be ) : (1 1, 2 2), (3 3, 4 4)
ps: the r1 is a JSON coordinates (multilinestring) that this format is exactly stored in SQL.. the number that I put just for reduce the confusion,
My code
declare @r1 varchar(max)= '[ [ [ 1, 1 ], [ 2, 2 ], [ 3, 3 ],[ 4, 4 ] ] ]'
declare @r2 varchar(max) = replace(replace(replace(@r1,' ',''), '[','('), ']',')')
select @r2
the result doesn't give me the format that I need.
'[ 'and' ]'