Hi all,
I am having a challenge when moving our application from Oracle 10g to 11g. I am (well, trying) to use Oracle 11.1.0.6.0 32-bit on a Windows 7.
My problem drills down to the following query:
Code:
SELECT firstname, patient_status_cd, patient_address.city
FROM patient
INNER JOIN patient_address
ON patient.patient_id = patient_address.patient_id
INNER JOIN cd_patient_status
ON patient.patient_status_cd = cd_patient_status.patient_status_cd;
This query executes well on oracle 10, but on 11 an
ORA-00918: column ambiguously defined is displayed instead for the patient_status_cd column.
As I wrote, it runs well on 10g. But - strangely - if I change the query by changing the order of the JOIN parts, then it breaks on 10g as well. So this:
Code:
SELECT firstname, patient_status_cd, patient_address.city
FROM patient
INNER JOIN cd_patient_status
ON patient.patient_status_cd = cd_patient_status.patient_status_cd;
INNER JOIN patient_address
ON patient.patient_id = patient_address.patient_id
breaks on 10g as well.
What I see is that Oracle has right - patient_status_cd is defined both in PATIENT and CD_PATIENT_STATUS tables. BUT, why does it run on 10g then???
Thanks for your thoughts!
Chris