2011-01-28 86 views
0

無法弄清楚這個postgresql錯誤在說什麼。PGError:錯誤:在「NULL」處或附近的語法錯誤

PGError: ERROR: syntax error at or near "NULL" 
LINE 1: ...at` < '2011-01-18 21:52:21.607956' OR `checked_at` IS NULL) 
                   ^
: SELECT * FROM "accounts" WHERE (`checked_at` < '2011-01-18 21:52:21.607956' OR `checked_at` IS NULL) 

任何想法可能是什麼?

+0

你嘗試過(`checked_at` < '2011-01-18 21:52:21.607956')或(`checked_at` IS NULL)? – Ski 2011-01-28 16:53:28

回答

3

反引號是你的問題。

SELECT * FROM accounts WHERE (checked_at < '2011-01-18 21:52:21.607956' OR checked_at IS NULL) 
0

試試這個:

SELECT * FROM accounts WHERE (checked_at < '2011-01-18 21:52:21.607956' OR checked_at IS NULL) 
+0

對不起,在發佈之前我沒有刷新 - 請看邁克爾的回答,因爲它是一樣的。 – jschorr 2011-01-28 16:56:50

相關問題