1

我的桌子在甲骨文蟾蜍中。表格包含列名电话号码 varchar2 数据类型。它包含一组电话号码。有些数字超过 10 个字符。我想从右侧 10 个字符中过滤该数字。

data's in the table
-------------------
phone number

9948184759
9948220955
994823298612
9948249815
99482599971234
9948277935
9948288258
99483015076789
9948335085
9948337552
9948338134

the above column values are phone numbers.but some numbers are more than 10 char length

that numbers are
----------------
 994823298612
 99482599971234
 99483015076789

 expected output for the above numbers
----------------------------------------
4823298612
2599971234
3015076789

Help me to do this? am new to oracle toad
4

2 回答 2

2

更简单:

select substr(phone_number, -10) from ...
于 2012-09-11T07:06:18.440 回答
0

例如,您可以通过使用 Substr 函数来实现

with T1 as 
( 
  select 99482599971234  n from dual union all
  select 99483015076789 n from dual union all
  select 994823298612 n from dual
) 

select substr(n, Length(n) - 9, 10) nn
  from t1


 Nn 
-------------------
4823298612 
2599971234 
3015076789 
于 2012-09-11T06:08:17.083 回答