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)
SQL> desc dept;
Name Null? Type
----------------------------------------- -------- ------------
DEPTNO NOT NULL NUMBER(2)
DNAME VARCHAR2(14)
LOC VARCHAR2(13)
求不同部门的平均工资,部门编号,部门名称。
SQL> select d.dname,e.deptno,e.avg(sal) from emp e,dept d where e.deptno=d.deptn
o group by e.deptno;
ERROR at line 1:
ORA-00904: "E"."AVG": invalid identifier
哪错了? |
|