首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

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

2012-03-18 
mysql字符串有空格的查询问题varchar字段,属性设置了binary,有个值为testSQL:select * from table where i

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);

热点排行