如:
create table a
(
a char(10)
)insert into a
select 'aa_bb'
union
select 'aa_cc'
union
select 'aa'
union
select 'a_b_c'select * from a
我要的结果是
aBC
aa
aaBb
aaCc
就是遇到'_'后面的第一个字段变成大写谢谢... ....
create table a
(
a char(10)
)insert into a
select 'aa_bb'
union
select 'aa_cc'
union
select 'aa'
union
select 'a_b_c'select * from a
我要的结果是
aBC
aa
aaBb
aaCc
就是遇到'_'后面的第一个字段变成大写谢谢... ....
http://community.csdn.net/Expert/topic/4974/4974681.xml?temp=.4806024
SELECT (case when charindex('_',a)<=0 then a else left(a,charindex('_',a)-1)+upper(replace(right(rtrim(a),len(a)-charindex('_',a)),'_','')) end) from a