select count(id) as tot from sbr_property where 1 = 1 and longitude <> '' and main_image <> '' and lookup_sbr_price_category in (3,9) 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')