Hi,
There is an emp table, which a column hiredate(date). I want to get the record with minimum hiredate and using this query.
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> with t as
2 (select 'A' ename, 1 enum, '1-Oct-2008' hiredate from dual union all
3 select 'B', 2, '1-Jan-2002' from dual union all
4 select 'C', 3, '1-Mar-2008' from dual)
5 select * from t
6 where hiredate = (select min(hiredate) from t);
E ENUM HIREDATE
- ---------- ----------
B 2 1-Jan-2002
SQL>
Is there any other way to do it, without using subquery?
Regards,
Ritesh