我有一个存储错误消息的数据库表,并且我想对它们运行各种查询。首先,我将它们分组这样得到的总次数:WHERE子句使用某些字符串文字失败
select MessageText, COUNT(*) from MessageLog group by MessageText
,其结果是:
1 Input string was not in a correct format 4
2 Value cannot be null. Parameter name: Int 8
3 Value cannot be null. Parameter name: String 1
现在,如果我尝试通过文本字符串来选择邮件,他们中的一些不返回结果即使消息存在。例如,
select * from MessageLog where MessageText = 'Value cannot be null. Parameter name: Int'
不会返回任何结果,即使上一个查询显示其中有8个结果。这个字符串无法匹配的是什么?
难道有额外的空格/你MessageText中后? –
这是用于SQL Server吗? –
哪个RDBMS?哪个版本? – 2011-10-17 22:30:55