Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Using a Select as a Var??
Chris L. wrote:
> On Jul 5, 3:51 pm, valigula <valig..._at_gmail.com> wrote:
>> On 5 jul, 19:50, DA Morgan <damor..._at_psoug.org> wrote: >> >> >> >> >> >>> Chris L. wrote: >>>>>> On Jul 5, 5:50 pm, valigula <valig..._at_gmail.com> wrote: >>>>>>> Hi All >>>>>>> Need top repeat a select 3 times but with differents where condition. >>>>>>> I tried to repeat the selects and after use a couple of union to join >>>>>>> then, but it takes toooo long. >>>> Instead of UNION you could use OR in your WHERE clause. >>>> Select * from sometable where name = 'JOHN' >>>> union >>>> Select * from sometable where salary > 500 >>>> union >>>> Select * from sometable where state <> 'NY'; >>>> Select * from sometable where name = 'JOHN' OR salary > 500 OR state >>>> <> 'NY'; >>>> If your queries take too long, try and index the tables. The index >>>> fields must match your WHERE fields. >>> Very inefficient compared with WITH. >>> -- >>> Daniel A. Morgan >>> University of Washington >>> damor..._at_x.washington.edu (replace x with u to respond) >>> Puget Sound Oracle Users Groupwww.psoug.org-Ocultar texto de la cita - >>> - Mostrar texto de la cita - >> Thanks chris the problem is: the querys are morre restrictives to do >> them in just 1 query ..- Hide quoted text - >> >> - Show quoted text -
given that you didn't post your SQL there's not much anyone can say other than 9.2.0.4? Applying a patch and getting closer to a supported product might make a difference.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Thu Jul 05 2007 - 19:02:11 CDT
![]() |
![]() |