老师这种可能更简单点哟!
if(command != null && !"".equals(command.trim())){stringBuilder.append(" and COMMAND='").append(command).append("'");
} if(description != null && !"".equals(description.trim())){
stringBuilder.append(" and DESCRIPTION like '%").append(description).append("%'");
}
if(command != null && !"".equals(command.trim())){stringBuilder.append(" and COMMAND='").append(command).append("'");
} if(description != null && !"".equals(description.trim())){
stringBuilder.append(" and DESCRIPTION like '%").append(description).append("%'");
}
SQLServer的模糊匹配是:and DESCRIPTION like '%'+#{description}+'%'
不知道为啥是这样
不知道为啥是这样
2017-12-11
SQLServer模糊匹配不管用,改成这面这样就可以,不知道为什么?
sql.append(" and DESCRIPTION like ?");//模糊匹配
buffer.add("%"+description+"%");
sql.append(" and DESCRIPTION like ?");//模糊匹配
buffer.add("%"+description+"%");
最新回答 / 慕移动9181930
一行显示一般需要用浮动技术,你可能还未接触吧。character-set-server设置也没有,我是初学者,用WAMPSERVER的。请老师指点。
2017-12-09