Convert address-offer query to SQL backend