Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL problem

Re: SQL problem

From: Doug O'Leary <dkoleary_at_mediaone.net>
Date: Fri, 29 Jun 2001 02:16:03 GMT
Message-ID: <MPG.15a5a2156e44eb689897a8@news.randori.com>

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.net
Received on Thu Jun 28 2001 - 21:16:03 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US