我有一個存儲錯誤消息的數據庫表,並且我想對它們運行各種查詢。首先,我將它們分組這樣得到的總次數: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