Simplify select from ORID query.