日期:2014-05-18 浏览次数:20706 次
select RIGHT(rtrim(name),len(name)-charindex(')',name))name from #s /* name ------------------------------ aaas aaa1 aaa2 (3 行受影响) */
------解决方案--------------------
create table #s (name char(30)) insert into #s select '(限50)aaas' insert into #s select '(限5)aaa1' insert into #s select '(限100)aaa2' go select RIGHT(rtrim(name),len(name)-charindex(')',name))name from #s /* name ------------------------------ aaas aaa1 aaa2 (3 行受影响) */
------解决方案--------------------
create table #s (name char(30)) insert into #s select '(限50)aaas' union all select '(限5)aaa1' union all select '(限100)aaa2' select STUFF(name,1,CHARINDEX(')',name),'') from #s drop table #s