Result of query not displaying result
I ran this query
SELECT
d.dept_name, e.gender, AVG(salary)
FROM salaries s
JOIN
employees e
ON e.emp_no = s.emp_no
JOIN
dept_emp de
ON de.dept_no = d.dept_no
JOIN
employees e
ON e.emp_no = de.emp_no
GROUP BY de.dept_no, e.gender
ORDER BY de.dept_no;
this is the result i get
why is the result wrong?
1 answers ( 0 marked as helpful)
Hi Nike!
Thanks for reaching out.
You used an alias twice which gives error message 1066. Also, the d.dept_name column is unknown.
Hope this helps.
Best,
Tsvetelin