我想查詢一個表中多個引用列不爲null。哪裏不是空的參考列顯示錯誤 - 鐵軌
我想是這樣的:( '?COMMENT_TEXT ==',無) JobTypePresetting.where JobTypePresetting.where( 'comment_text_id ==還是part_listing_id ==?',零,零)
即使第一工作不顯示錯誤,如
ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR: operator does not exist: integer == unknown
LINE 1: ...resettings"."template_id" = $2 AND (comment_text_id == NULL)
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
如何查詢此,我目前使用像
JobTypePresetting.where('comment_text_id is not null or part_listing_id is not null')
你想一個等號,而不是雙。 –