Im trying to pull two different account numbers from an ms query on an Oracle DB via ODBC with PHP. The problem is that two of the columns have the same name, e.g. ACCOUNT_NO
SELECT V_GUARANTORS2.ACCOUNT_NO, V_GUARANTORS2.GUARANTOR_NAME, V_GUARANTORS2.LOAN_NO, CURRENT_LOANS.ACCOUNT_NO, CURRENT_LOANS.LOAN_PRINC, MEMBERS.SHARES FROM LOOK.CURRENT_LOANS CURRENT_LOANS, LOOK.MEMBERS MEMBERS, CU.V_GUARANTORS2 V_GUARANTORS2 WHERE CURRENT_LOANS.ACCOUNT_NO = MEMBERS.ACCOUNT_NO AND V_GUARANTORS2.LOAN_NO = CURRENT_LOANS.LOAN_NO AND ((V_GUARANTORS2.ACCOUNT_NO Is Not Null) AND (CURRENT_LOANS.LOAN_PRINC>0) AND (MEMBERS.SHARES<CURRENT_LOANS.LOAN_PRINC))
I've tried using an alias on the query but ms query won't accept alias'. I've tried using the full name of the columns i.e. 'V_GUARANTORS2.ACCOUNT_NO' but I get a php error saying the field name is not found.
Our support crowd might be able to change the column names to something more unique but I'd like to find a better solution in case this comes up again. Anyone have any ideas?