Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL problem
In article <9hfra1$cme$1_at_goodnews.ijs.si>, rok.kodrun_at_uni-lj.si says...
>
>I tried with embedded select with ROWNUM and COUNT and so on but failed to
>get right records, because you can not order in embeded SELECT.
You are correct; but you can order a view, then get a select number of rows that.
I'm not sure of your table structure, or I'd be able to show you real queries; however, this should get you started:
create or replace view view_name
as select log, time, tekst
from log
order by time desc;
select * from view_name
where rownum < 8;
<< Displays 8 records in descending time order>>
HTH; Doug
-- ------------------- Douglas K. O'Leary Senior System Administrator dkoleary_at_mediaone.netReceived on Thu Jun 28 2001 - 21:16:03 CDT
![]() |
![]() |