On Mon, Oct 08, 2007 at 07:03:14PM +0200, Daniel Fetchinson wrote:
> > SELECT COUNT(*) FROM named LEFT JOIN cage ON ((animal.cage_id) = (cage.id))
> > LEFT JOIN zoo ON ((cage.zoo_id) = (zoo.id))
> > WHERE (((named.name) = ('myzoo')) AND ((named.child_name) = ('animal')))
> >
> >    for which SQLite returns the error:
> >
> > sqlobject.dberrors.OperationalError: no such column: animal.cage_id
> 
> The result should be 5 because that query should select the total
> number of animals in the zoo 'myzoo'. Without inheritance the query
> works and prints 5, hence my guess that there is a problem with
> inheritance. The query should return the same result with or without
> inheritance, or?

   Without inheritance the query is completely different:

SELECT COUNT(*) FROM animal LEFT JOIN cage ON ((animal.cage_id) = (cage.id)) 
LEFT JOIN zoo ON ((cage.zoo_id) = (zoo.id))
WHERE ((zoo.name) = ('myzoo'))

   Yes, that gives 5.

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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to