将Oracle样式连接转换为ANSI SQL连接

时间:2012-09-21 07:40:40

标签: sql oracle ms-access

我有一个oracle数据库的查询,我通过ODBC使用MS Access访问它。

这个查询不能用于访问我需要在标准SQL中转换它,我已经尝试过几次没有成功。我想知道是否可以帮助我谢谢!

   select t2.s_studentreference "Ad No"
        , t1.p_surname "Surname"
        , t1.p_forenames "Forenames"
        , t3.e_reference "Reference"
        , t3.e_name "Name" 
    from capd_a t2
       , capd_b t1
       , capd_c t3 
   where t2.s_id(+)=t1.p_id 
     and (t3.e_student=t1.p_id) 
     and (t3.e_reference='D /YR2A2/12') 

1 个答案:

答案 0 :(得分:3)

如果standard SQL表示ANSI SQL,那么您的查询可能会是这样的

   select t2.s_studentreference "Ad No"
        , t1.p_surname "Surname"
        , t1.p_forenames "Forenames"
        , t3.e_reference "Reference"
        , t3.e_name "Name" 
    from capd_b t1
   right outer join capd_a t2
      on (t2.s_id = t1.p_id)
    join capd_c t3 
      on ((t3.e_student=t1.p_id) and (t3.e_reference='D /YR2A2/12'))