Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL question
Hallo James,
> I just need one output for each ID with the data from the last
> timestamp.
First you must select the last timestamp for each id: id, max(timestamp)
Because you need the data of the last timestamp, you should use the results of the first select to get the result in a second select:
select * from <your_table>
where (id, timestamp) in (select id, max(timestamp) from <your_table>)
Ciao Thomas Received on Sun Jan 12 2003 - 02:08:00 CST
![]() |
![]() |