|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
hi,
i have a record with different dates created, num 10/31/2003 2:48:48 PM , 123456 1/7/2004 8:23:58 AM, 123456 9/23/2004 8:16:26 PM, 123456 9/13/2004 2:48:10 PM, 123456 5/7/2004 10:30:57 AM, 123456 SELECT MAX(created) AS recent, num FROM test GROUP BY num this will give: 9/23/2004 8:16:26 PM, 123456 what is the sql to get: 9/13/2004 2:48:10 PM,123456 ???? |
|
#2
|
|||
|
|||
|
Code:
SELECT MAX(created) AS recent, num FROM test t where created < (select max(created) from test where test.num = t.num) GROUP BY num |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > query for second latest date |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|