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: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sat, 09 Oct 2004 12:29:44 -0700
Message-ID: <1097350269.570139@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 - 14:29:44 CDT

Original text of this message

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