posts - 120, comments - 55, trackbacks - 0, articles - 8
  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理

公告

MS SQL入门基础:字符串函数

Posted on 2007-11-08 00:36 孤峰皓月 阅读(66) 评论(0) 编辑 收藏
http://bbs.51cto.com/thread-433820-1-1.htmldeclare @code varchar(50)
select top 1 @code = UserCode from Info_User where charindex('071030',UserCode)>0 order by id desc
select @code
set @code=substring(@code,10,len(@code))
select @code
set @code='111'
set @code = @code +1
set @code = right('000'+convert(varchar,@code),3)
select @code