If the value of the column availabilityId has got the same value for every productId then are the maximum and minimum value equal. Because of that should a
GROUP BY productId
with
HAVING (MIN(availabilityId) = 1 AND MAX(availabilityId) = 1)
produce the desired result.