SQLSERVER截取字符串

 DECLARE @Name NVARCHAR (50)
SET @Name = '\EXAM\061023478874' DECLARE @Position INT --sql first indexof
SET @Position = CHARINDEX('.', @Name);
SELECT SUBSTRING (@Name, @Position+1,LEN(@Name)-@Position) --sql last indexof
SET @Position = LEN(@Name) - CHARINDEX('\', REVERSE(@Name)) + 1
SELECT SUBSTRING (@Name, @Position+1,LEN(@Name)-@Position)
上一篇:Django简单的数据库操作


下一篇:php opcode缓存