Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> SQL question
Hi! I would appreciate help on the following SQL question. I have a
table that contains data such as:
ID Name Value1 Value2 Systime
---- ------ ------ ------ ------- 1 AAA 10 25 01-Jan-1996 1 BBB 100 250 01-Dec-1995 1 AAA 20 50 10-Jan-1996 1 BBB 200 20 05-Jan-1996 1 MMM 250 240 11-Jan-1996etc.
I would like to write a SQL statement to return the name, value1, value2
and systime where the systime is the most recent for a distinct name. For
instance, the output would give me the row with name AAA and systime
10-Jan-1996 and
the row with name BBB and systime 05-Jan-1996, etc. I have tried to use
functions such as max and group by but because I want the values printed,
I can't get the report to come together. Any ideas?
Thanks for any help!
Leanne
leanne_at_lilly.com
(Oracle 7.1, HPUX)
Received on Fri Jan 12 1996 - 09:01:49 CST
![]() |
![]() |