select * from tbl_BID_BidManufacturers where ownerId = and ownerType = and bidMfrId = Jennie-O has #qmd_bidManufacturers.recordCount# bids.
select distinct bidDstId from tbl_BID_BidDistributors where ownerId = and ownerType = and bidId in ( ) and in those bids, have #qmd_bidDistributors.recordCount# distributors altogether.

select distinct territoryId, name from tbl_TER_Territories ter inner join tbl_CDR_Distributors cd on ter.territoryId = cd.cdr_territoryId and ter.ownerId = cd.ownerId and ter.fsl_tablecode = cd.fsl_tablecode inner join tbl_BID_Distributors bd on cd.cdr_recordId = bd.cdr_recordId and cd.ownerId = bd.ownerId and cd.fsl_tablecode = bd.ownerType where bd.bidDstId in ( ) Possible territories are:
 #territoryId# - #name#