Re: [PERFORM] rewrite in to exists?

2003-09-19 Thread Manfred Koizar
On Thu, 18 Sep 2003 12:27:23 -0700 (GMT-07:00), LN Cisneros <[EMAIL PROTECTED]> wrote: >But, the EXISTS version doesn't Laurette, looking at that SELECT statement again I can't see what's wrong with it. One of us is missing something ;-) > really give me what I want... Can you elaborate? SELEC

Re: [PERFORM] rewrite in to exists?

2003-09-18 Thread LN Cisneros
03 10:34 AM To: LN Cisneros <[EMAIL PROTECTED]>, LN Cisneros <[EMAIL PROTECTED]>, Manfred Koizar <[EMAIL PROTECTED]>, Christopher Kings-Lynne <[EMAIL PROTECTED]> Cc: LN Cisneros <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Subject: Re: [PERFORM] rewrite in

Re: [PERFORM] rewrite in to exists?

2003-09-18 Thread Josh Berkus
Laurette, > >SELECT t1.code, t1.id, t1.date_of_service > > FROM tbl t1 INNER JOIN > > (SELECT DISTINCT date_of_service > > FROM tbl > > WHERE xxx >= '29800' AND xxx <= '29909' > > AND code = 'XX' > > ) AS t2 ON (t1.date_of_service = t2.date_of_service) > > WHERE

Re: [PERFORM] rewrite in to exists?

2003-09-18 Thread LN Cisneros
On Thu, 18 Sep 2003 13:23:37 +0800, "Christopher Kings-Lynne" >To the original poster: You did not provide a lot of information, but >the following suggestions might give you an idea ... > Yes, sorry about that. But in my query for a set of dates returned from the subquery I would then like

Re: [PERFORM] rewrite in to exists?

2003-09-18 Thread Manfred Koizar
On Thu, 18 Sep 2003 13:23:37 +0800, "Christopher Kings-Lynne" <[EMAIL PROTECTED]> wrote: >Why can't you just go: > >select code, id, name, date_of_service from tbl where xxx <= 29800 and xx >= >29909 and code='XX' and client_code='XX' order by id, date_of_service; Because (ignoring conditions on c

Re: [PERFORM] rewrite in to exists?

2003-09-17 Thread Christopher Kings-Lynne
> I'm on 7.3.4 and this query gets horrible performance. Is there a way to rewrite it with an exists or some way to get better performance? > > select code, id, name, date_of_service > from tbl > where date_of_service in > (select date_of_service > from tbl > where xxx >=

[PERFORM] rewrite in to exists?

2003-09-17 Thread LN Cisneros
I'm on 7.3.4 and this query gets horrible performance. Is there a way to rewrite it with an exists or some way to get better performance? select code, id, name, date_of_service from tbl where date_of_service in (select date_of_service from tbl where xxx >= '29800'