Join query returning 0 rows - impossible where
this query is supposed to return a list of the top 10 brands (other than the selected brand) that are purchased with the selected brand.


Try this:

SELECT `2_products`.`brand`, COUNT(*) as numOrders
FROM `2_products`
INNER JOIN `1_txns` ON `1_txns`.sku=`2_products`.sku
INNER JOIN (SELECT `1_txns`.`txn_id` 
    FROM `1_txns`
    INNER JOIN `2_products` USING (sku)
    WHERE brand = :brand) as tmp_txns ON tmp_txns.txn_id=`1_txns`.txn_id
WHERE brand &lt;&gt; :brand
GROUP BY brand
ORDER BY numOrders desc, brand ASC
LIMIT 10;


Example sqlfiddle