Select department number, t. t. department name, avg (t. salary) "average wage" from ( The select E.d eptno department number, D.d name "department name," E.s al "wages" The from emp "E" The join dept "D" on d.d eptno=e.d eptno Where e.s al & gt;=1500 "T" Group by t. department number,
Emp dept for orical sample table, last line of code if remove the "t. department name" is an error, why? Department name is common feature in the group, and why can't we get rid of? Is because he is from the dept table? Strives for the bosses to solve, thank you!
CodePudding user response:
Had better send the table structure, easy to do test,