跳至内容
菜单
此问题已终结
2 回复
5414 查看

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.

形象
丢弃
最佳答案

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

 

形象
丢弃
最佳答案

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.


形象
丢弃
相关帖文 回复 查看 活动
2
6月 18
5900
0
12月 15
3484
1
11月 22
5563
2
5月 22
33736
1
10月 21
3240