问题描述
|
我正在尝试运行如下所示的sql
select name from appointments where location_id in (2,3,4)
以下不起作用。我正在使用PostgreSQL
a = [2,4]
Appointment.select(:name).where(\"location_id IN ?\",a)
ActiveRecord::StatementInvalid: PGError: ERROR: syntax error at or near \"2\"
LINE 1: ... FROM \"appointments\" WHERE (location_id IN 2,4)
^
: SELECT name FROM \"appointments\" WHERE (location_id IN 2,4)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)