Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simplify SQL select
Message
 
To
28/05/1998 14:50:53
Jeroen Naus
Harte-Hanks Europe
Hasselt, Belgium
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00102530
Message ID:
00102910
Views:
35
>Splitting the cursor in 2 would speed up the selects and simplify the problem. Since you're running the first query only once.
>
>select lim_val.code, lim_txt.lim_num, lim_txt.lim_text, ;
> lim_txt.lim_suffix ;
> from lim_val, lim_txt ;
> where lim_txt.lim_num = lim_val.lim_num ;
> and lim_txt.lang_code = m.lang_activ ;
> into cursor curTemp1
>
>select lim_val.code, lim_def.lim_num, lim_def.lim_text, ;
> lim_def.lim_suffix ;
> from lim_val, lim_def ;
> where lim_def.lim_num = lim_val.lim_num ;
> and lim_def.lang_code = m.lang_activ ;
> and lim_val.code + str(lim_val.lim_num) not in ;
> (select curTemp1.code + str(curTemp1.lim_num) from curTemp1 );
> into cursor curTemp2
>
>And then union the 2 results in a third select.
>
>Another thing you can do if your looking for less code is union the two selects and then use a group by on your key field(s). Use this group by only if you're sure that the values of lim_num and or lim_suffix are the same in both lim_txt and lim_def.
>
>Hope you understand what I mean.
>

Jeroen,

Actually, I was thinking of something along the lines of an Outer Join on this. It kinda seemed that like this was the intent of the original SELECT. I couldn't be sure that this was the case so i asked what the business use of the SELECT.
Menachem Bazian, CPA
President
BC Consulting Services, Inc.
973-773-7276
Menachem@BazianCentral.com
Previous
Reply
Map
View

Click here to load this message in the networking platform