Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Performance
Message
From
26/01/2000 14:57:53
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvania, United States
 
 
To
26/01/2000 12:43:57
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00322775
Message ID:
00323072
Views:
25
I was thinking about the general case where the complex Select structure includes redundant clauses. My example was overly simplified (and kind of dumb, as you pointed out :)

I'm joining the result of 4 multi-table Selections into a single file. Each select is grouped successively higher. In this case, it makes more sense to have:
Select * from Source, into cursor qcTable1 Group By lowest_group
Select * from qcTable1, into cursor qcTable2 Group By low_group
Select * from qcTable2, into cursor qcTable3 Group By mid_group
Select * from qcTable3, into cursor qcTable4 Group By high_group

Select * from qcTable1 Union;
`Select * from qcTable2 Union;
`Select * from qcTable3 Union;
`Select * from qcTable4 into cursor qcOutput

the actual code is far more cumbersome (about a screenful each Select)
By separating the job into 4 pieces that keep grouping off the previous result, the job is very fast. By comparison, i couldn't even figure out how to express this in one select statement.

(FYI, lowest_=6000, low_=1500, mid_=40, high_=13 records)
Previous
Reply
Map
View

Click here to load this message in the networking platform