Re: Avoid multiple scan of the same table

From: <maks71_at_gmail.com>
Date: Fri, 22 Aug 2008 06:34:52 -0700 (PDT)
Message-ID: <0fc0925f-7cab-4c6e-bd45-a75638e8a647@e53g2000hsa.googlegroups.com>


On Aug 21, 7:08 pm, DA Morgan <damor..._at_psoug.org> wrote:
> mak..._at_gmail.com wrote:
> > Is there way to avoid multiple scan of the same table in following?
>
> > Select c1 as v1, c2 as v2, c3 as v3
> > From t1
> > Union
> > Select c1 as v1, c2 as v2, c4 as v3
> > From t1
> > Where  c5 < 5000
>
> > The output should look like..
>
> > v1, v2, v3
> > v11, v21, v31
> > v12, v22, v32
> > and so on.
>
> > Rows from the both queries can be same so UNION is required to avoid
> > duplicates in current construct.
>
> One way would be to use a WITH CLAUSE query.http://www.psoug.org/reference/with.html
> --
> Daniel A. Morgan
> Oracle Ace Director & Instructor
> University of Washington
> damor..._at_x.washington.edu (replace x with u to respond)
> Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text -
>
> - Show quoted text -

Pls. explain with above example.. I have given the problem query with expected output.. Received on Fri Aug 22 2008 - 08:34:52 CDT

Original text of this message