left join problem -
11-03-2006
, 11:07 PM
Ok, I am coming from a mysql background, which I have used for a couple of
years. But now I am wanting to try out PostgreSQL as a learning
experience. Well I have a sql statement which does work in mysql, but not
Postgresql. Can some one tell me why.
Select object.ObjName, const.ConstName, object.DateSeen,
object.TimeSeen, telescope.TelName,
object.Magnification, object.Magnitude, location.Location,
object.Conditions, objtype.ObjType from object, const, objtype
Left Join telescope on object.Telescope = telescope.TelIdx
Left Join location on object.location = location.LocIdx
Where object.ObjCon = const.ConstIdx and
object.ObjType = objtype.ObjTypeIdx;
The databases are identical.
The error is postgre is:
NOTICE: adding missing FROM-clause entry for table "object"
ERROR: JOIN/ON clause refers to "object", which is not part of JOIN
My server is 8.0.3 running on fc4.
The problem is definitely in the left join's, I have removed them and
added table links in my where clause and it works (but not the way I want
it to!) |