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

Home -> Community -> Usenet -> c.d.o.server -> Re: Sql problem

Re: Sql problem

From: Bosco Ng <boscong_at_leccotech.com>
Date: Tue, 13 May 2003 21:20:09 +0800
Message-ID: <3ec0fd38$1@shknews01>


thx

"andrewst" <member14183_at_dbforums.com> wrote in message news:2868586.1052747737_at_dbforums.com...
>
> Originally posted by Bosco Ng
> > I have a sql statement that looks like this
> >
> > select
> > a.c1,
> > a.c2,
> > b.c3,
> > some_pkg.find_last_record(a.c1, b.c3)
> > from a,
> > b
> > where a.id = b.id
> > and some_pkg.find_last_record(a.c1, b.c3) is not null
> >
> >
> > the some_pkg.find_last_record takes the 2 parameters to find the
> > last record
> > that match them.
> >
> > The problem now is that when this sql fire, it will execute 2
> > times the
> > some_pkg.find_last_record for 2 times, is there a way to only
> > firing it for
> > 1 time?
> >
> >
> > Thanks
> Do this:
>
> select c1,c2,c3,c4 from
> ( select
> a.c1,
> a.c2,
> b.c3,
> some_pkg.find_last_record(a.c1, b.c3) c4
> from a,
> b
> where a.id = b.id
> )
> where c4 is not null
>
> --
> Posted via http://dbforums.com
Received on Tue May 13 2003 - 08:20:09 CDT

Original text of this message

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