Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    kualalumpur
    Posts
    89

    Unanswered: problem with order by clause

    hello oracle developers..
    could u help me in solving this..
    select deptno
    from emp
    minus
    (select deptno
    from emp
    union
    select a.deptno
    from emp a
    group by deptno
    having count(ename)>3
    order by deptno desc )

    Iam getting error as follows..cud u help me to solve this..

    order by deptno desc )
    *
    ERROR at line 11:
    ORA-00907: missing right parenthesis

    Actually for example I used this.. Iam facing a similer kind of problem elsewhere..
    thanks in advance

  2. #2
    Join Date
    Feb 2004
    Location
    Hong Kong
    Posts
    15

    Re: problem with order by clause

    Originally posted by sridharreddy_d
    hello oracle developers..
    could u help me in solving this..
    select deptno
    from emp
    minus
    (select deptno
    from emp
    union
    select a.deptno
    from emp a
    group by deptno
    having count(ename)>3
    order by deptno desc )

    Iam getting error as follows..cud u help me to solve this..

    order by deptno desc )
    *
    ERROR at line 11:
    ORA-00907: missing right parenthesis

    Actually for example I used this.. Iam facing a similer kind of problem elsewhere..
    thanks in advance

    order by clause is at end but it is applied for the first statement. Therefore, you have to change as follows:

    select deptno
    from emp
    minus
    (select deptno
    from emp
    union
    select a.deptno
    from emp a
    group by deptno
    having count(ename)>3) ----> should be here
    order by deptno desc

    Hope it works fine

  3. #3
    Join Date
    Nov 2003
    Location
    kualalumpur
    Posts
    89

    Re: problem with order by clause

    Originally posted by nsarbeswar
    order by clause is at end but it is applied for the first statement. Therefore, you have to change as follows:

    select deptno
    from emp
    minus
    (select deptno
    from emp
    union
    select a.deptno
    from emp a
    group by deptno
    having count(ename)>3) ----> should be here
    order by deptno desc

    Hope it works fine
    yah.. thank u very much..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •