Oleg:

Thanks for this. It works just as I'd hoped. Just had to change the Contact.q.contactId to Contact.q.id.

   -Jim

Oleg Broytmann wrote:
On Wed, Jun 20, 2007 at 10:42:21AM -0500, Jim Steil wrote:
SELECT * FROM contact WHERE contactId IN (SELECT contactId FROM
contactCategory WHERE categoryId IN (1,3))

from sqlobject.sqlbuilder import IN, Select
Contact.select(IN(Contact.q.contactId,
   Select([ContactCategory.q.contactId], IN(ContactCategory.q.categoryId, 
[1,3]))))

PS. Yes, SQLBuilder can distinguish these two IN()s automagically.

Oleg.

-------------------------------------------------------------------------
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
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to