刚学SQL,请大家帮我看看。
create table #a
(
fnumber varchar(255),
fshortNumber varchar(255)
)Insert into #a
Select 'A01' union all
Select 'A01.01' union all
Select 'A01.01.001' union all
Select 'A01.002' union all
Select 'A01.002.01.0004' 希望将fshortNumber 更新成为最后一个'.'后的值。没‘.’就等于fnumber列。谢谢大家!结果是select * from #a
A01 A01
A01.01 01
A01.01.001 001
create table #a
(
fnumber varchar(255),
fshortNumber varchar(255)
)Insert into #a
Select 'A01' union all
Select 'A01.01' union all
Select 'A01.01.001' union all
Select 'A01.002' union all
Select 'A01.002.01.0004' 希望将fshortNumber 更新成为最后一个'.'后的值。没‘.’就等于fnumber列。谢谢大家!结果是select * from #a
A01 A01
A01.01 01
A01.01.001 001
解决方案 »
- SQL Server 活动监视器的问题
- group by 问题
- 我的XP系统为什么不能安装SQL2000 的服务端,只能安装客户端
- ADO -2147217871[Microsoft][ODBC SQL Server Driver]Timeout expired
- 求满足条件的数据的id号的最大差
- 解决sql server 2005 windows身份验证登录失败
- WIN7 64位安装SQL SERVER 2008 R2 报错,,,请问如何解决?
- 向大家请教一SQL函数或方法!~~高手进!速度接帖!
- 怎样设置数据库为只读,怎样在改回来,最好能系统介绍一下这方面的知识,谢谢!
- 请Sql高手试试
- 更新列的问题。
- 一个行列转换的问题。
(
fnumber varchar(255),
fshortNumber varchar(255)
) Insert into #a(fnumber)
Select 'A01' union all
Select 'A01.01' union all
Select 'A01.01.001' union all
Select 'A01.002' union all
Select 'A01.002.01.0004' UPDATE #a SET
fshortNumber=RIGHT(fnumber,CHARINDEX('.',REVERSE('.'+fnumber))-1)select * from #adrop table #a