I have an items table that is related to an item_tiers table. The second table consists of inventory receipts for an item in the items table. There can be 0 or more records in the item_tiers table related to a single record in the items table. How can I, using query, get only records that have 1 or more records in item tiers….
results = session.query(Item).filter(???).join(ItemTier)
Where the filter piece, in pseudo code, would be something like …
if the item_tiers table has one or more records related to item.
If there is a foreign key defined between tables, SA will figure the join condition for you, no need for additional filters.