-1

hello i have row of data 1000 records, that i need to replace and substring in the format like below:

i have this format 004320487091 and i need to convert it to 0.432.487.091 any thought any helps please?

Aycan Yaşıt
  • 2,106
  • 4
  • 34
  • 40
osama
  • 5
  • 4

2 Answers2

0

If the string is always going to be same format as mentioned in your question then try this. Use STUFF Function to get the result.

select stuff(stuff(stuff(stuff('004320487091',3,0,'.'),7,1,'.'),11,0,'.'),1,1,'')
Pரதீப்
  • 91,748
  • 19
  • 131
  • 172
0

you can use concat plus substring like that

SELECT concat(substring('004320487091',2,1)
,'.',
(substring('004320487091',3,3))
,'.',
(substring('004320487091',7,3))
,'.',
(substring('004320487091',10,3)))
Dudi Konfino
  • 1,126
  • 2
  • 13
  • 24