Select: replacing id for @rid