SELECT COUNT(listings.zoneid) AS listingcount, zone.id, zone.name FROM zone, listings, soldstatus, picture WHERE (zone.id = listings.zoneid) AND (soldstatus.id = listings.soldstatusid ) AND soldstatus.shown = 'Y' AND ((picture.amhash = listings.pictureid) AND (picture.sdefault = 'Y')) GROUP BY listings.zoneid ORDER BY zone.name Invalid query