Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Is there better SQL statement than this ?
Hi,
Why are you using the intersect to join the statements? The statements look exactly the same with the exception of the pmp.paramValue. My guess would be something like.....
select pmc.oid from productModelParam pmp, productModelCategory pmc
where pmc.oid = pmp.oid
and pmc.categoryValue = '3E965F2E-F64E-9ECE-1B3872409AC42428'
and pmp.paramValue in ('TH', '50Vdc', '0603')
Allan
"Park Yeon Jo" <kudos12_at_netian.com> wrote in message
news:d7fe264d.0301270442.7e9fa9bd_at_posting.google.com...
> It takes too long time to execute the following SQL statement ?
>
> Is there better SQL statement than this ?
>
> I didn't make any Indexes on two tables yet.
>
> Please give me the hints.
>
>
>
>
> ==================================================================
> select pmc.oid from productModelParam pmp, productModelCategory
pmc
> where pmc.oid = pmp.oid
> and pmc.categoryValue = '3E965F2E-F64E-9ECE-1B3872409AC42428'
> and pmp.paramValue = 'TH'
>
> intersect
>
> select pmc.oid from productModelParam pmp, productModelCategory pmc
> where pmc.oid = pmp.oid
> and pmc.categoryValue = '3E965F2E-F64E-9ECE-1B3872409AC42428'
> and pmp.paramValue = '50Vdc'
>
> intersect
>
> select pmc.oid from productModelParam pmp, productModelCategory pmc
> where pmc.oid = pmp.oid
> and pmc.categoryValue = '3E965F2E-F64E-9ECE-1B3872409AC42428'
> and pmp.paramValue = '0603'
Received on Mon Jan 27 2003 - 06:59:58 CST