日期:2014-05-17  浏览次数:20389 次

sql字符串截取查询
在student表中查询出学号为S2011012左右的学生信息,也就是查询S2011011和S2011013的全部信息,求大神解答
------解决方案--------------------
select * from Student where ID='S'+ltrim(convert(int,right('S2011012',7)-1))union all
select * from Student where ID='S'+ltrim(convert(int,right('S2011012',7)+1))