0
我需要在表where id == question_id
中更新「狀態」字段。我試過,但它不工作:如何使用條件更新數據庫表中的值?
Questions.update_all("status = status_id.to_i",
["id = question_id"])
我有這樣的錯誤:
Mysql2::Error: Unknown column 'question_id' in 'where clause': UPDATE `questions` SET status = status_id.to_i WHERE (id = question_id)