select count(id) as tot from sbr_property where 1 = 1 and longitude <> '' and main_image <> '' and lookup_sbr_price_category <> 3 and lookup_sbr_listing_status in (6,13,16) and (is_master is null or is_master = 'False') and (archived is null or archived = 'False') and (internet_advertising_off is null or internet_advertising_off = 'False')