Home » SQL & PL/SQL » SQL & PL/SQL » Group by clause (
Group by clause [message #289544] Sun, 23 December 2007 23:21 Go to next message
Messages: 585
Registered: November 2007
Location: NE
Senior Member

Hi I have written a query . but I am getting error as " colmn ambigiouly defined.."

Here is my query ..pls check the code and correct it pls..

select comments ref2,to_loc,from_loc,create_date,
 from shipment    shp,
      head     thd,
      detail   tdt,
      period      per,
      wareh          wah,
      ships     shs
where    order_no is null
and      thd.tsf_type                 = 'EG'
and      thd.status                   not in ('C','D')
and      thd.create_date             <= (per.vdate - 1)
and      thd.create_id               != 'If' --  pick
and      thd.tsf_no                   = tdt.tsf_no
and      nvl(tdt.tsf_qty,0)           > (nvl(tdt.received_qty,0) + nvl(tdt.cancelled_qty,0))
and      thd.tsf_no                   = shs.distro_no   (+)
and      shs.shipment                 = shp.shipment    (+)
and      thd.to_loc                   = wah.physical_wh (+)
and      wah.returns_wh (+)     = 'Y'

group by shp.comments,tdt.item,tdt.f_no,thd.f_no 
order by  thd.create_date,

Thank u.

[Updated on: Sun, 23 December 2007 23:22]

Report message to a moderator

Re: Group by clause [message #289545 is a reply to message #289544] Sun, 23 December 2007 23:24 Go to previous messageGo to next message
Messages: 25523
Registered: January 2009
Location: SoCal
Senior Member
>but I am getting error as " colmn ambigiouly defined.."

Error? What error? I don't see any error.

I'm glad to see you found & used <code tags>.
Now use CUT & PASTE to show whole session, line numbers & errors.
Re: Group by clause [message #289546 is a reply to message #289544] Sun, 23 December 2007 23:38 Go to previous message
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member

you may be having a similar field name in the tables.

select ename name1,ename name2 from emp e,emp_copy ec
where e.empno=ec.empno

Error at Command Line:1 Column:19
Error report:
SQL Error: ORA-00918: column ambiguously defined
00918. 00000 -  "column ambiguously defined"

prefix the table alias.

Previous Topic: UTIL File Error
Next Topic: Total Count
Goto Forum:

Current Time: Thu Jul 20 22:17:27 CDT 2017

Total time taken to generate the page: 0.06722 seconds