Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
5324 Zobrazení

Hi Friends,

How to split a character which is separated by (:) operator like OUT/1234: SO/14-15/345.I need output as SO/14-15/345 by only using sql query.Please help me in this situation.Thanks in advance.

Avatar
Zrušit
Nejlepší odpověď

select substring(column_name, position(':' in column_name)+1, length(column_name)) from table_name 

 

Avatar
Zrušit
Nejlepší odpověď

Hello vadivel,

Try this query.

select *,

substring(dat,1,charindex('-',dat)-1) as Section,

substring(dat,charindex('-',dat)+1,charindex('-',dat)-1) as TownShip,

reverse(substring(reverse(dat),0,charindex('-',reverse(dat)))) as myRange

from myTable;



I hope it's work.

Thank you.


Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
čvn 18
5838
0
pro 15
3441
1
lis 22
5348
2
kvě 22
33560
1
říj 21
3144