這可能是一個愚蠢的問題,但任何人都可以解釋爲什麼SQL返回'False'
用於SQL字符串對比IF
IF 'test' = ' test' -- notice leading space
SELECT 'True'
ELSE
SELECT 'False'
但返回'True'
爲
IF 'test' = 'test ' -- notice trailing space
SELECT 'True'
ELSE
SELECT 'False'
編輯:
我m使用SQL Server 2008 R2
是你使用MySQL或其他數據庫? – Melon
+1不傻,實際上有趣:) – everton
我會認爲這是一個BUG :) –