sql中在where字句里截取字符方法如下:1、如果是sqlserver:where left(p.end_time,4) = '2012'。2、如果是Oracle:where substr(p.end_time,0,4) = '2012'。举例:1、oracle: 'where substr(字段名,1,2)='''123''''2、sqlserver: 'where substring(字段名,1,2)='''123''''