求大大们解释一下这段
special =left(b.dynaev1,len(b.dynaev1)-charindex('X',reverse(b.dynaev1)))
是什么意思...
越详细越好,我看不懂= =!
------解决方案--------------------
给你一个例子;
select baseunitrate = convert( int ,right(b.dynaev1,len ( b.dynaev1)- len(left(b.dynaev1,len(b.dynaev1)
-charindex('X',reverse(b.dynaev1))) )-1))
from
(
select '100X100X5' dynaev1
)b
/*
baseunitrate
5
*/
------解决方案--------------------
select baseunitrate = convert( int ,right(b.dynaev1,len ( b.dynaev1)- len(left(b.dynaev1,len(b.dynaev1)
-charindex('X',reverse(b.dynaev1))) )-1))
from
(
select '100X100X5' dynaev1
)b
/*
baseunitrate
5
*/
这个代码的意思应该是,找字符串中的最后一个x,之后的数字,提取出来
------解决方案--------------------
你拿个字符串,替换b.dynaev1这个列名,然后逐部分执行一下,体会一下,然后看看联机丛书