17,377
社区成员
发帖
与我相关
我的任务
分享
SELECT COUNT(a.employee_id) AS"TATAL",
COUNT(b.employee_id) AS"1995",
COUNT(c.employee_id) AS"1996",
COUNT(d.employee_id) AS"1997",
COUNT(e.employee_id) AS"1998"
FROM employees a,
(SELECT employee_id FROM employees WHERE hire_date > '31-12月-95') b,
(SELECT employee_id FROM employees WHERE hire_date > '31-12月-96') c,
(SELECT employee_id FROM employees WHERE hire_date > '31-12月-97') d,
(SELECT employee_id FROM employees WHERE hire_date > '31-12月-98') e
SELECT COUNT(a.employee_id) AS"TATAL",
sum(case when a.hire_date > date '1995-01-01' then 1 else 0 end) 1995,
sum(case when a.hire_date > date '1996-01-01' then 1 else 0 end) 1996,
sum(case when a.hire_date > date '1997-01-01' then 1 else 0 end) 1997,
sum(case when a.hire_date > date '1998-01-01' then 1 else 0 end) 1998,
FROM employees a
SELECT COUNT(a.employee_id) AS"TATAL",
sum(case when a.hire_date > date '1995-01-01' then 1 else 0 end) 1995,
sum(case when a.hire_date > date '1996-01-01' then 1 else 0 end) 1996,
sum(case when a.hire_date > date '1997-01-01' then 1 else 0 end) 1997,
sum(case when a.hire_date > date '1998-01-01' then 1 else 0 end) 1998,
FROM employees a
select to_char(hiredate, 'yyyy-mm-dd'), count(1)
from employee
where hire_date between to_date('1995-01-01', 'yyyy-mm-dd') and
to_date('1998-12-31', 'yyyy-mm-dd')
group by to_char(hiredate, 'yyyy-mm-dd')