【发布时间】:2016-01-27 08:24:08
【问题描述】:
以下查询在 Mysql 中有效,但在 postgresql 中无效。
Campaign.scheduled_with_community_ids(community_ids).
joins(:community).
order('FIELD(campaigns.id, #{editable_ids}) DESC').
order(:launch_date, 'communities.community_name')
正在低于错误
ActiveRecord::StatementInvalid - PG::SyntaxError: ERROR: syntax error at or near "{" LINE 2: ...s" = 's_approved')) ORDER BY FIELD(campaigns.id, #{editable_...
请任何人帮助我
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-3 postgresql