请帮我看一下,谢谢。我想明白下面是什么意思及详细的变量取数原理
SELECT @startPosition = CHARINDEX(@str,@chrWhere,0)
IF @startPosition = 0
RETURN
SELECT @endPosition = CHARINDEX(@str,@chrWhere,@startPosition+1)
IF @endPosition = 0
RETURN
SELECT @attribute = SUBSTRING(@chrWhere,@startPosition+1,@[email protected])
SELECT @startPosition = CHARINDEX(@str,@chrWhere,@endPosition+1)
IF @startPosition = 0
RETURN
SELECT @endPosition = CHARINDEX(@str,@chrWhere,@startPosition+1)
IF @endPosition = 0
RETURN
SELECT @start = SUBSTRING(@chrWhere,@startPosition+1,@[email protected])
SELECT @startPosition = CHARINDEX(@str,@chrWhere,@endPosition+1)
IF @startPosition = 0
RETURN
SELECT @endPosition = CHARINDEX(@str,@chrWhere,@startPosition+1)
IF @endPosition = 0
RETURN
SELECT @end = SUBSTRING(@chrWhere,@startPosition+1,@[email protected])
------解决方案--------------------
[email protected]@[email protected]
SELECT @startPosition = CHARINDEX(@str,@chrWhere,0)
IF @startPosition = 0
RETURN
[email protected]
SELECT @endPosition = CHARINDEX(@str,@chrWhere,@startPosition+1)
IF @endPosition = 0
RETURN
[email protected]@[email protected]
SELECT @attribute = SUBSTRING(@chrWhere,@startPosition+1,@[email protected])
--下面意思差不多