GWTプロジェクト用にPostgreSQL9.2.2サーバーを実行しています。
phpPgAdminの[sql]タブで試してみると、正常に機能するため、1つのクエリで問題が発生します。
(select distinct max(enddate) as max,meterid
from usermeasurements
where locationid=127025
AND usage>-1
GROUP BY meterid ) as t1
left outer join usermeasurements as t2
ON (t1.meterid=t2.meterid
AND t1.max=t2.enddate)
しかし、gwtプロジェクトでクエリを使用しようとすると、次のエラーが発生します。
[btpool0-5] ERROR com.example.DataGetter - unable to get usermeasurement: org.postgresql.util.PSQLException: ERROR: syntax error at or near "as" Position: 112
phpPgAdminとアプリで機能するものの違いを経験したのは初めてです。
ご覧のとおり、接続プールを処理するためにBoneCPを使用していますが、私が知る限り、それは何の効果もありません。