Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with Decode fuction
"Tom Miskiewicz" <miskiewicz2_at_yahoo.com> wrote in message
news:VRGdb.6$p1.19019_at_news.ecrc.de...
> > Consider this:
> >
> > select decode(count(1),1,0,null) from DUAL
> > where exists (select 1 from my_table
> > where field 1 = 'STRING1' ......... )
> >
> > Case instead of Decode is easier to read if your version permits it.
>
> What about this one?:
>
> select decode(count(1),1,0,null) from DUAL
> where exists (select 1 from pm_ticketroutinglinks
> where classification = 'PROCUREMENT_NEW' AND
> component_type = 'CLIENT_HARDWARE' AND
> component = 'PC_DELL');
>
> Thanks
> Tom
>
>
This you have to answer yourself ... does it float your boat?
Does it reduce the number of consistent reads you have to do to achieve your
purpose ..
Does it give you the correct results?
In case you are wondering what are consistent reads .. then you need to read
a lot about performance
tuning.
For a start I can only say: "set autotrace on" in sqlplus and look at the
consistent reads. Usually
lower is better...
Anurag Received on Sun Sep 28 2003 - 15:09:13 CDT
![]() |
![]() |