我有以下查询:
Score.where("build_id => ? AND metric_id => ? ",params[:buildIds], params[:metricIds])
其中 params[:buildIds], params[:metricIds] 是整数数组。我收到此错误:
PG::Error: ERROR: operator does not exist: integer => integer
LINE 1: SELECT "scores".* FROM "scores" WHERE (build_id => 1,2 AND ...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
: SELECT "scores".* FROM "scores" WHERE (build_id => 1,2 AND metric_id => 1,13 )
有什么帮助吗?
谢谢