SQL("JDBC3", "select count(nc.student_id) from class_schedule_item csi LEFT JOIN named_classes nc ON csi.id=nc.class_schedule_id where nc.campus_status =1" +if(len(Q25)=0,' and 1=2',"csi.id='"+Q25+"'") , 1) 这一部分没有报错 SQL("JDBC3", "select count(nc.student_id) from class_schedule_item csi LEFT JOIN named_classes nc ON csi.id=nc.class_schedule_id where nc.campus_status =1" +if(len(Q25)=0,' and 1=2',"csi.id='"+Q25+"'")+ if(len(D4)=0,'and 1=2',"and left(csi.start_time,10)='"+D4+"'") , 1) 换成这个不报错 SQL("JDBC3", "select count(nc.student_id) from class_schedule_item csi LEFT JOIN named_classes nc ON csi.id=nc.class_schedule_id where nc.campus_status =1 and left(csi.start_time,10)="+D4+"" +if(len(Q25)=0,' and 1=2',"csi.id='"+Q25+"'") , 1) |