Rails query interface where clause issue?
问题 i am try to run the sql query as follows @applicants = Applicant.where("applicants.first_name LIKE ? AND applicants.status = ?", "%#{people}%", ["new", "in-review"] ) I am getting an mysql error as : 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')): can anyone help me in this thanks in advance 回答1: You have to use IN clause of mysql