标签:and exist primary border def color lsp evel subject
无
dept_no | dept_name | title | count |
---|---|---|---|
d001 | Marketing | Senior Engineer | 1 |
d001 | Marketing | Staff | 1 |
d002 | Finance | Senior Engineer | 1 |
d003 | Human Resources | Senior Staff | 1 |
d004 | Production | Senior Engineer | 2 |
d005 | Development | Senior Staff | 1 |
d006 | Quality Management | Engineer | 2 |
d006 | Quality Management | Senior Engineer | 1 |
select t1.dept_no,dp.dept_name,t1.title,t1.count from ( select d.emp_no,d.dept_no,t.title,count(1) as count from dept_emp d inner join titles t on d.emp_no=t.emp_no and d.to_date=‘9999-01-01‘ and t.to_date=‘9999-01-01‘ group by d.dept_no,t.title ) t1 inner join departments dp on t1.dept_no=dp.dept_no ;
标签:and exist primary border def color lsp evel subject
原文地址:https://www.cnblogs.com/guoyu1/p/12706706.html