sql语句substring 用法

来源:互联网 发布:mac去哪放光盘 编辑:程序博客网 时间:2024/06/15 09:35

select t.OperationLog,
case when charindex('ID为',t.OperationLog)>1 then
SUBSTRING(t.OperationLog,
charindex('ID为',t.OperationLog)+3
,charindex(')',t.OperationLog)-charindex('ID为',t.OperationLog)-3)
end ,
t.CreatePersonId,
t.* from PaymentOrder t where t.UpdateDate>'2016-1-1'

0 0
原创粉丝点击