sql语句substring 用法


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'


你可能感兴趣的:(数据库)