Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Select from dual.
Just want to add to this solution:
*dont*, and I mean DONT! ever add extra extries in dual!
You may consider creating your own trivial table, and
code like select * from trivial; but stay away from dual!
joseharvey_at_my-deja.com wrote:
> Hi Nicky,
> > I've got a question. Is it possible to make a select from dual that
returns
> > mutiple rows?
> well, it IS possible, try something like this:
> select 'Row1' test from dual union (select 'row2' from dual);
> TEST
> ----
> Row1
> row2
> 2 rows selected.
>
> But dual is built just to deliver one value when you need it.
>
> If you need a collection of rows, it is probably better to perform a
> query like this:
> select rownum Test from all_objects where rownum < 10;
> TEST
> ----------
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 9 rows selected.
>
> Cheers
>
> Jose
> --
> -=[ Sancho ]=-
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
-- Gtrz, Frank van BortelReceived on Wed Nov 01 2000 - 12:49:24 CST
![]() |
![]() |