如何从drop中获取第七个数字'drop'#drop#drop#drop#drop#drop#drop sql中列的值?

时间:2017-06-15 09:18:51

标签: sql sql-server

我在数据库中有一个列具有以下值  drop#drop#drop#drop#drop#drop#drop#drop

我希望从此值中获得第7个数字 我不想拆分字符串。

1 个答案:

答案 0 :(得分:-1)

select substr('drop#drop#drop#drop#drop#drop#drop#drop',instr('drop#drop#drop#drop#drop#drop#drop#drop','drop',1,7),4) as "Drop7th" from dual;