如何截取abcd前面的字符串
qadabcd (1werwe)
adfabcd (好1df)
avabcd (wew3r231df)
qaabcd (/1werwe)
ssabcd (we好1df)
sdfabcd (fwerwew3r231df)
查询后
qad
adf
av
...
[解决办法]
declare @t table (col varchar(30))insert into @tselect 'qadabcd (1werwe)' union allselect 'adfabcd'select left(col,charindex('abcd',col)-1) from @t/*qadadf*/