Hi,
I am trying to follow up the first example in:
http://www.sqlobject.org/FAQ.html#how-can-i-do-a-left-join

it should return same results as the following SQL select:

SELECT customer.id, customer.first_name, customer.last_name, contact.id,
contact.address
FROM customer
LEFT JOIN contact ON contact.customer_id = customer.id

*Example given on the web is:*
for customer in Customer.select():
    print customer.firstName, customer.lastName
    for contact in customer.contacts:
        print ' ', contact.phoneNumber

but my feeling is it should be something like:

for customer in Customer.select():
    print customer.firstName, customer.lastName
    for contact in Contact.select(Contact.q.customer.id==customer.id):
        print ' ', sale.aged

Please let me know, how the given example works or what I am overlooking
(missing).

Regards

Petr Jakes
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to