34,838
社区成员




select left(col,len(col)-5) from tb where right(col,5) like 's%'
select stuff(col,len(col)-5,5,'') from tb where charindex('s',right(col,5))=1
select * from tb where right(col,5) not like 's%'
select * from tb where charindex('s',right(col,5))!=1
select * from tb where col not like '%s[0-9][0-9][0-9][0-9]'
--如果确定右边五个不要,可直接如下
select left(col , len(col) - 5) from tb when len(col) > 5
select left(col , charindex('s',col) - 1) from tb where charindex('s',col) > 0