-
Hi all,
I have the following data.
Table X
no name runtime
15 xyz 12:20:10
14 xya 12:20:10
13 xyb 12:20:10
12 xyc 12:20:10
11 xyd 12:20:10
10 xye 12:20:10
9 xyf 12:10:05
8 xyg 12:10:05
7 xyh 12:10:05
6 xyz 12:20:00
5 xya 12:20:00
4 xyb 12:20:00
3 xyc 12:20:00
2 xyd 12:20:00
2 xye 12:20:00
I need to build a view on this data and select only the latest rows that have run last at the same time runtime. I would NOT know the run when I run the statement. In the above, the result should have rows from no=15 thru no=10 (runtime 12:20:10).
I suppose I could do the following way:
select * from X
where runtime=(select runtime from X where rownum<2 order by runtime desc);
Any suggestion please.
Thanks,
Ramesh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|