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

Home -> Community -> Usenet -> c.d.o.misc -> Re: A query in Oracle Report

Re: A query in Oracle Report

From: mo <m_at_m.com>
Date: Sun, 10 Oct 2004 10:52:25 +0800
Message-ID: <cka88t$iql7@imsp212.netvigator.com>


Yes, that's why I want to sort it first. The result should be 'Dan' and 'Eliz'
for my case.

"Daniel Morgan" <damorgan_at_x.washington.edu> wrote in message news:1097350269.570139_at_yasure...
> mo wrote:
>
> > when I issue a query in Oracle Report:
> >
> > 1. select * from
> > 2. (
> > 3. select first_name, last_name
> > 4. from students
> > 5. order by first_name
> > 6. )
> > 7. where rownum<3;
> >
> > I received a warning of missing a ")", if I
> > omit the 5th line, it's fine. should I use a cursor
> > to solve it?
>
> SQL> create table students (
> 2 first_name varchar2(20),
> 3 last_name varchar2(20));
>
> Table created.
>
> SQL> insert into students values ('Dan','Morgan');
>
> 1 row created.
>
> SQL> insert into students values ('Jack','Cline');
>
> 1 row created.
>
> SQL> insert into students values ('Eliz.','Scott');
>
> 1 row created.
>
> SQL> insert into students values ('Kent','Stroker');
>
> 1 row created.
>
> SQL> commit;
>
> Commit complete.
>
> SQL> SELECT * FROM (
> 2 SELECT first_name, last_name
> 3 FROM students)
> 4 WHERE rownum < 3;
>
> FIRST_NAME LAST_NAME
> -------------------- --------------------
> Dan Morgan
> Jack Cline
>
> SQL>
>
> I don't think so!
>
> --
> Daniel A. Morgan
> University of Washington
> damorgan_at_x.washington.edu
> (replace 'x' with 'u' to respond)
>
Received on Sat Oct 09 2004 - 21:52:25 CDT

Original text of this message

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