|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Trouble selecting the most recent value
Have a table like this (sorry for the formatting:
ID1 ID2 DATE ID2Value 1 12 1/1/2006 6 1 24 1/1/2006 400 1 24 6/1/2006 410 1 36 6/1/2006 100 2 12 1/1/2007 7 2 24 6/1/2007 350 2 24 7/1/2007 360 I need to return 1 row for each ID1 value - and only the ID2 value of 24 and only the most recently dated record for the multiple ID2 values - query would return: 1 24 6/1/2006 410 2 24 7/1/2007 360 I have worked and worked on this and I am still stumped (part of the problem may be I am also trying to make this work in Crystal Reports but that is for another day). I need to make this work in Oracle first. Any direction please? All suggestions appreaciated. Many thanks, Winelover |
|
#2
|
||||||
|
||||||
|
Quote:
Try something like: SQL Code:
Clive. |
|
#3
|
|||
|
|||
|
Thanks - that helped my thought process. In that form, took too long with my gigantic tables, but helped get me where I needed to go.
Appreciate the help. |
|
#4
|
|||
|
|||
|
Last edited by DrewSmith70 : April 16th, 2008 at 09:35 AM. Reason: Added message |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Trouble selecting the most recent value |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|