I have SQL query, which is working nice on Oracle and MSSQL. Now I'm trying this on PostgreSQL and it gives a strange exception: org.postgresql.util.PSQLException: ERROR: missing FROM-clause entry for table "main"
Here is the query:
SELECT *
FROM "main" main
INNER JOIN "something_link" something_link ON main."id" = something_link."mainid"
INNER JOIN "something" somehting ON something_link."somethingid" = something."id"
INNER JOIN "type" type ON something."typeid" = type."id"
This is quite simple query and I can't see why it is not working on Windows XP SP2, PostgreSQL 8.3?