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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL*plus: join operator error

Re: SQL*plus: join operator error

From: Knut Talman <knut.talman_at_mytoys.de>
Date: Mon, 29 Apr 2002 14:16:21 +0200
Message-ID: <3CCD3995.7060104@mytoys.de>


Sted Alana wrote:

> I cannot get this query to work with the join operator. I get the error
> below. I believe it has something to do with my syntax.
>
> Any help appreciated.
>
> SQL> select dname
> 2 from emp e join dept d on e.deptno = d.deptno
> 3 group by dname
> 4 having sal > 4000;
>
> from emp e join dept d on e.deptno = d.deptno
> *
> ERROR at line 2:
> ORA-00933: SQL command not properly ended

Of course you don't tell us your Oracle version. Try

select e.dname
from emp e, dept d
where e.deptno = d.deptno
group by e.dname
having e.sal > 4000;

If you are using Oracle 9i you can play with the join syntax. Try LEFT JOIN.

Regards,

Knut Received on Mon Apr 29 2002 - 07:16:21 CDT

Original text of this message

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