Potential revenue issue in select query