select e_id,e_name,avg(salary),max(salary),min(salary)from dep,emp where dep.d_id=emp.d_id group by e_id,e_name;
select e_id,e_name,avg(salary),max(salary),min(salary) from dep,emp
where dep.d_id=emp.d_id
如果不是你字段有错误,就是from左右没有空格吧
select dep.d_id, dep.d_name, avg(emp.salary), max(emp.salary), min(emp.salary) from dep, emp where dep.d_id=emp.d_id group by emp.d_id
group by e_id