mysql字符串有空格的查询有关问题

mysql字符串有空格的查询问题

varchar字段,属性设置了binary,有个值为test

SQL:

select * from table where id=’test ‘;可以得到记录

问题是我不想当尾部有包含空格的可以查询得到

如果不通过where id = binary ‘test ‘;

是否还有其他办法?谢谢!



select * from table where id=’test ‘ and len(rtrim(id))=len(id);

mysql字符串有空格的查询有关问题

相关文章:

你感兴趣的文章:

标签云: