在子查询中选择一个额外的表

时间:2014-07-16 13:13:03

标签: ms-access

我需要能够在此子查询中从另一个表中选择一个额外的列,有人可以提供帮助:

SELECT *
  FROM tblPRAU_REMOVALS_DATA
 WHERE NOT EXISTS 
       (SELECT tblNOD_OPAG_OP_DATA.[PID (NOD)] 
          FROM  tblNOD_OPAG_OP_DATA  
         WHERE tblPRAU_REMOVALS_DATA.[Person ID] 
                                      = tblNOD_OPAG_OP_DATA.[PID (NOD)]);

我试图在下面修改,但无济于事:

SELECT  tblNOD_OPAG_OP_DATA.OpName, 
        tblPRAU_REMOVALS_DATA.[Person ID]
  FROM tblPRAU_REMOVALS_DATA 
                 INNER JOIN tblNOD_OPAG_OP_DATA 
                 ON tblPRAU_REMOVALS_DATA.[Person ID] 
                                 = tblNOD_OPAG_OP_DATA.[PID (MASTER)]
 WHERE NOT EXISTS (
            SELECT tblNOD_OPAG_OP_DATA.[PID (NOD)] 
              FROM tblNOD_OPAG_OP_DATA
             WHERE  tblPRAU_REMOVALS_DATA.[Person ID] 
                                           = tblNOD_OPAG_OP_DATA.[PID (NOD)]);

0 个答案:

没有答案