2012-09-21 76 views
1

我對Oracle數據庫有此查詢,我正在通過ODBC使用MS Access訪問它。將Oracle樣式轉換轉換爲ANSI SQL加入

此查詢不適用於訪問我需要將它轉換爲標準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') 

回答

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')) 
+0

感謝尼古拉,我會在幾分鐘內測試,並儘快接受它。謝謝 – GibboK