select t.title,avg(salary) as avg
from salaries as s join titles as t
on s.emp_no = t.emp_no
and s.to_date = '9999-01-01'
and t.to_date = '9999-01-01'
group by title
考察join连接和分组统计
select t.title,avg(salary) as avg
from salaries as s join titles as t
on s.emp_no = t.emp_no
and s.to_date = '9999-01-01'
and t.to_date = '9999-01-01'
group by title
考察join连接和分组统计