| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Select from dual.
In our last gripping episode Frank van Bortel <fbortel_at_home.nl> wrote:
> 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 Bortel
>
>
I have seen many implementations using a table named DUMMY in addition to DUAL for this very reason.
-- David Fitzjarrell Oracle Certified DBA Sent via Deja.com http://www.deja.com/ Before you buy.Received on Wed Nov 01 2000 - 13:25:31 CST
![]() |
![]() |