Advertisement
Guest User

Untitled

a guest
May 27th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. select x.ename,y.dname, round(to_char(sysdate,'yyyy') - to_char(hiredate,'yyyy')) an_vechime
  2. from emp x,dept y where x.deptno = y.deptno and
  3. x.deptno = (select a.deptno from emp a
  4. having count(a.empno) in
  5. (select max(count(empno)) from emp
  6. where (to_char(sysdate,'yyyy') - to_char(hiredate,'yyyy')) >20
  7. group by deptno
  8. )
  9. group by a.deptno);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement