View previous topic :: View next topic |
Author |
Message |
onesource Beginner
Joined: 26 Jan 2011 Posts: 6 Topics: 3
|
Posted: Wed Feb 16, 2011 11:52 am Post subject: retrieve the row which has lowest date |
|
|
Hello,
I want to retrieve a row from table which contains lowest date OUT_DATE (format DATE).
Could any one pls help to write the query?
thanks in advance. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Feb 16, 2011 12:05 pm Post subject: |
|
|
onesource,
Unless I am missing something isn't it a simple task of using the FETCH FIRST?
Untested sql
Code: |
SELECT DATE_COL
FROM TABLE
ORDER BY DATE_COL
FETCH FIRST 1 ROW ONLY
; |
Kolusu |
|
Back to top |
|
 |
onesource Beginner
Joined: 26 Jan 2011 Posts: 6 Topics: 3
|
Posted: Wed Feb 16, 2011 12:18 pm Post subject: |
|
|
Thanks a lot. |
|
Back to top |
|
 |
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Wed Feb 16, 2011 1:45 pm Post subject: |
|
|
Or even select min(date_col) . . . ? _________________ All the best,
di |
|
Back to top |
|
 |
|
|