Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> ORA-00918: column ambiguously defined

ORA-00918: column ambiguously defined

From: <timothy.hill_at_gmail.com>
Date: 20 Feb 2007 05:33:29 -0800
Message-ID: <1171978409.651174.106350@q2g2000cwa.googlegroups.com>


Hi,

I am getting the above error when I try and run the query below on bb.tab_urn. However, removing this group by then gives the same error, but at bb.transaction_date. Unless I have missed something completely, I am certain I have defined everything correctly. Thoughts? Any help would be very much appreciated!

Cheers

Tim

select com.name

, curr.quantity
, prev.quantity
from ( select count(*) as quantity , a.tab_urn from v_rep_vehicle_check_3m_trans a where a.CLASS_CODE in ('TDCP', 'TDCC') and a.TRANSACTION_DATE between to_date('2007-01-01000000','YYYY-MM-DDHH24MISS') and to_date('2007-01-31235929','YYYY-MM-DDHH24MISS') and a.tab_urn not in (0,10) group by a.tab_urn) curr full outer join ( select count(*) as quantity , bb.tab_urn from v_rep_vehicle_check_3m_trans bb where bb.CLASS_CODE in ('TDCP', 'TDCC') and bb.transaction_date between add_months(to_date('2007-01-01000000','YYYY-MM-DDHH24MISS'),-1) and add_months(to_date('2007-01-31235929','YYYY-MM-DDHH24MISS'),-1) and bb.tab_urn not in (0,10) group by bb.TAB_URN) prev on prev.tab_urn = curr.tab_urn , rep_curr_company com

where curr.tab_urn = com.tab_urn
OR prev.tab_urn = com.tab_urn
order by

          com.name; Received on Tue Feb 20 2007 - 07:33:29 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US