我收到下一条错误消息:
public function getAverage()
{
// calculate the $average;
return $average;
}
尝试执行查询时:
SQL Error [500310] [42725]: [Amazon](500310) Invalid operation: function pg_catalog.substring(character varying, smallint, smallint) is not unique;
答案 0 :(得分:1)
这很奇怪,我认为您已经找到一个错误!对smallint感到不满意。
但是您可以像这样轻松地解决它
select SUBSTRING(a.string,b.index::integer,b.length::integer)
from a
JOIN
b
ON a.id=b.id