SELECT bl.name location,COUNT(DISTINCT CASE WHEN tsl.line_discount_amount>0 THEN t.id END) promo_transactions,COUNT(DISTINCT CASE WHEN tsl.line_discount_amount=0 THEN t.id END) regular_transactions FROM business_locations bl JOIN transactions t ON bl.id=t.location_id JOIN transaction_sell_lines tsl ON t.id=tsl.transaction_id WHERE t.type="sell" GROUP BY bl.id,bl.name ORDER BY promo_transactions DESC;