发布网友
共1个回答
热心网友
1.
select '所有 ' HIREDATE,cnt from
(select count(*) cnt from emp ) t
union all
select to_char(HIREDATE, 'yyyy ') HIREDATE,count(*) from emp
group by to_char(HIREDATE, 'yyyy ');
2.
select distinct count(*) over() as "All_Count ",
to_char(tt.HIREDATE, 'yyyy ') as "year ",
count(*) over(partition by to_char(tt.HIREDATE, 'yyyy ')) as "count "
from emp tt
where to_char(tt.HIREDATE, 'yyyy ') in (1980,1981,1982,1983);
3.
select max(emp.SALARY) - min(emp.SALARY) from emp
先给三个 ~~~ 呵呵 睡觉了~