Dear all,
why doesn't the last statement query any values?
suppose:
SQL> select * from test;
TEMP_DATE
---------
14-APR-11
15-APR-11
16-APR-11
SQL> select months_between(to_date((select temp_date from test where rownum=1)),to_date((select temp_date from test where rownum=2)))test from test;
TEST
----------
I try to get the greatest date from temp_date column of test table but instead I got null values dump. What went wrong?
Is there any easier way to compare those values using GREATEST (I can do it easily with MAX function though)?
best regards,
Val
Edited by: Valerie Debonair on Apr 14, 2011 8:48 PM