select products.*, companies.*, locations.location from products, companies, locations where products.compid = companies.compid and products.origincountryid = locations.countryid and locations.zoneid = 99 and products.imgfilenr > 0 and products.offline = 0 and companies.totalpayments > 0 and ((match(productname) against ('+wire +spools13pitch +12pitch-516-716-916 +-34 +inch' IN BOOLEAN MODE))) group by companies.compid order by companies.rating desc, products.promotionid desc limit 0, 5