我是嘗試如下Rails查詢接口where子句問題?
@applicants = Applicant.where("applicants.first_name LIKE ? AND applicants.status = ?", "%#{people}%", ["new", "in-review"])
我正在一個MySQL錯誤作爲運行SQL查詢:
ActionView::Template::Error (Mysql2::Error: Operand should contain 1 column(s): SELECT `applicants`.* FROM `applicants` WHERE (applicants.first_name LIKE '%sh%' AND applicants.status = 'new','in-review')):
誰能幫我在這
由於事先
你能幫我看看這個查詢嗎?請按照鏈接http://pastebin.com/2vup4PWD –
@applicants = Applicant.includes(:jobs).where(「applicants.first_name LIKE?AND applicants.location LIKE?AND jobs.job_title LIKE?」,「%#{人們%「,」%#{位置}%「,」%#{more_job}%「) – Salil
謝謝,它適用於我,但有點變化。而不是包括(:工作),我用包括(:工作) –