1、字符串截取substr
=left(a1,2)意思是取A1左面就是前面开始去2个字符
=right(a1,3)及时A1右面 就是走后面开始取3个字符
要是中间取
=mid(a1,2,4)
就是走A1的第2个开始取4个 字符
就是 2 3 4 5 位~
oracle中如何取得字符串的左边的几位?
substr(string,m,n)
m从第几位取,如为负数表示从右至左取
n共取几位
--查找所有数据
select distinct(ftmobile),foprcode from weblocation.x_boss_history
where to_char(ftime,'yyyy-mm-dd') = '2012-03-05'
and foprcode = '110002'
and
ftmobile in
(
select substr(ferroetext,1,11) from weblocation.x_sys_errorlog t
where to_char(fctime,'yyyy-mm-dd') ='2012-03-05'
and ferroetext not in ('D302未开通业务')
group by ferroetext
)
select * from weblocation.x_boss_history
--查找重复数据
select * from
(
select distinct(ftmobile),foprcode from weblocation.x_boss_history
=left(a1,2)意思是取A1左面就是前面开始去2个字符
=right(a1,3)及时A1右面 就是走后面开始取3个字符
要是中间取
=mid(a1,2,4)
就是走A1的第2个开始取4个 字符
就是 2 3 4 5 位~
oracle中如何取得字符串的左边的几位?
substr(string,m,n)
m从第几位取,如为负数表示从右至左取
n共取几位
select distinct(ftmobile),foprcode from weblocation.x_boss_history
where to_char(ftime,'yyyy-mm-dd') = '2012-03-05'
and foprcode = '110002'
and
ftmobile in
(
select substr(ferroetext,1,11) from weblocation.x_sys_errorlog t
where to_char(fctime,'yyyy-mm-dd') ='2012-03-05'
and ferroetext
group by ferroetext
)
select * from weblocation.x_boss_history
select * from
(
select distinct(ftmobile),foprcode from weblocation.x_boss_history
