Implemented the selects and subselects (subrequests).