日期:2014-05-17 浏览次数:20872 次
/*1.1*/ select e.ename,e.hiredate from emp e where e.hiredate=(select min(hiredate) from emp) union all select e.ename,e.hiredate from emp e where e.hiredate=(select max(hiredate) from emp);
select e.ename,e.hiredate from emp e where e.hiredate in ((select min(hiredate) from emp),(select max(hiredate) from emp));
SELECT ENAME, T.HIREDATE FROM EMP T WHERE NOT EXISTS (SELECT 1 FROM EMP T1 WHERE T1.HIREDATE < T.HIREDATE) OR NOT EXISTS (SELECT 1 FROM EMP T1 WHERE T1.HIREDATE > T.HIREDATE)