Home » SQL & PL/SQL » SQL & PL/SQL » can anyone help me in solving this query
can anyone help me in solving this query [message #232023] Thu, 19 April 2007 02:05 Go to next message
sathyam2627
Messages: 52
Registered: November 2006
Member
hi,
when i am executing the below query its returning an error message
can u plz help me in this

this is desc of emp table
SQL> desc emp
Name Null? Type
----------------------------------------- -------- ----------------
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)



1 select ename
2 from emp > all
3 (select avg(sal)
4* from emp group by avg(sal) )
SQL> /
from emp > all
*
ERROR at line 2:
ORA-00933: SQL command not properly ended


regards,
sathya
Re: can anyone help me in solving this query [message #232024 is a reply to message #232023] Thu, 19 April 2007 02:09 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
You miss the part starting with WHERE
Re: can anyone help me in solving this query [message #232029 is a reply to message #232023] Thu, 19 April 2007 02:25 Go to previous messageGo to next message
ammishra
Messages: 179
Registered: January 2007
Location: india
Senior Member
plz try this


select ename
from emp where sal > all
(select avg(sal)
 from emp  )





--Yash
Re: can anyone help me in solving this query [message #232096 is a reply to message #232029] Thu, 19 April 2007 07:14 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
But, exactly how many rows do you expect from your "select avg(sal)" ?
No need for the all.
Previous Topic: problem with insert in procedure !!!!!
Next Topic: SQL Statement Error
Goto Forum:
  


Current Time: Tue Dec 06 15:55:14 CST 2016

Total time taken to generate the page: 0.17767 seconds