An Error Was Encountered

Error Number: 1242

Subquery returns more than 1 row

SELECT SQL_CALC_FOUND_ROWS `pr`.`id` AS 'id', `pr`.`name` AS 'name', `rt`.`name` AS 'realty', `gl`.`name` AS 'area', `pr`.`address` AS 'address', `pr`.`street` AS 'street', `pr`.`city` AS 'city', `pr`.`state` AS 'state', `pr`.`country` AS 'country', `pr`.`descr_s` AS 'descr_s', `pr`.`bedrooms` AS 'bedrooms', `pr`.`bathrooms` AS 'bathrooms', `pr`.`sleeps` AS 'sleeps', `pr`.`featured` AS 'featured', (SELECT `filepath` FROM `lb_property_imgs` WHERE `lb_property_imgs`.`property_id` = `pr`.`id` AND `lb_property_imgs`.`front_img` = 'Y') as 'image' FROM `lb_properties` AS `pr` LEFT JOIN `lb_realtytypes` AS `rt` ON `rt`.`id` = `pr`.`realty_type` LEFT JOIN `lb_geo` AS `gl` ON `gl`.`id` = `pr`.`geo_id` WHERE `pr`.`active` = 'Y' AND `pr`.`realty_type` = 2 AND ((SELECT COUNT(*) FROM `lb_listings` WHERE `lb_listings`.`property_id` = `pr`.`id` AND `lb_listings`.`active` = 'Y') > 0) ORDER BY `pr`.`name` ASC LIMIT 0,20