Given:

class Vendors(Entity):
    using_options(tablename="vendors")

    vendorid = Field(Unicode, primary_key=True)
    vendname = Field(Unicode)
    items = ManyToMany('Items')

class Items(Entity):
    using_options(tablename="items")

    itemnmbr = Field(Unicode, primary_key=True)
    itemdesc = Field(Unicode)
    vendors = ManyToMany('Vendors')


How do I construct the query to select those Vendors that have no
Items
 vnd.items == []
or the equivalent of the sql statement:
SELECT *
  FROM vendors
  WHERE vendorid NOT IN (
    SELECT vendors_vendorid
      FROM vendors_items__items_vendors)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to