On Wed, Jun 27, 2007 at 03:04:26PM +0200, [EMAIL PROTECTED] wrote:
> SELECT object.id FROM object
> LEFT JOIN attribute attr1 ON ((object.id) = (attr1.object_id)), object
> LEFT JOIN attribute attr2 ON ((object.id) = (attr2.object_id))
> WHERE (((attr1.value) > (2.0)) AND ((attr2.value) < (5.0)))
>
> As you can see, there is a second ", object" before the second join. Why is
> that? If I can tell correctly, this one is superfluous, right? Am I doing
> something wrong (e.g. is it even allowed to pass a list of joins to join?)
> or how can I do this correctly?
The first parameter to a JOIN() can be None to avoid superfluous table:
join = [ LEFTJOINOn(Object, attr1, Object.q.id == attr1.q.objectID)
, LEFTJOINOn(None, attr2, Object.q.id == attr2.q.objectID)
]
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss