Subselects and Locations

A subselect cannot reference a location different from the one referenced elsewhere in the command. That is, a referenced table and all subselects in a single SQL statement must be from the same location.

Invalid:

SELECT * FROM tutorial.tutorial.employee
WHERE e_no IN
  SELECT e_no FROM debloc.debbie.employee
  WHERE st = "MD";

Valid:

SELECT * FROM tutorial.tutorial.employee
WHERE e_no IN
  SELECT e_no FROM tutorial.debbie.employee
  WHERE st = "MD";