SELECT count(DISTINCT purchase.id) as DATAOBJECT_NUM                 FROM purchase INNER JOIN purchaseCustomerInfo ON purchase.id=purchaseCustomerInfo.purchaseId AND purchaseCustomerInfo.type IN('billing','both')   WHERE ( purchase.permissions LIKE 'r__' ) 