Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to factor my cursor?
Message
From
07/09/2006 11:53:29
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
How to factor my cursor?
Miscellaneous
Thread ID:
01151893
Message ID:
01151893
Views:
83
I have a cursor with records as follows:
Route  Class  SType  Family  PrevPassngers PrevMult PrevNumTrips CurrPassengers CurrMult  CurrNumTrips
0588          D      G                386      1.75       676.79
0588          D      G                                                     147      1.00        147.00
0588          D      G                                                     194      1.00        194.00
0588          D      G                                                     313      1.00        213.00
0011          C      B                 33      1.75        57.86
0011          C      B                                                       1      1.00          1.00
0016          C      E                675      1.75      1183.51  
0016          C      E                                                       3      1.00          3.00
0016          C      E                                                      17      1.00         17.00
0016          C      E                                                      10      1.00         10.00
...

and need to condense/combine them into 1 rec for each Route/ClassStype/Family combo, i.e.

Route  Class  SType  Family  PrevPassngers PrevMult PrevNumTrips CurrPassengers CurrMult  CurrNumTrips
0588          D      G                386      1.75       676.79           554      1.00        554.00
0011          C      B                 33      1.75        57.86             1      1.00          1.00
0016          C      E                675      1.75      1183.51            30      1.00         30.00
Is there a quick SQLish way of doing this without having to loop and append and accumulate and all that?
There could just as easily be many recs to the left (prev) side to one or few on the right (curr)

'ppreciate it

Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Next
Reply
Map
View

Click here to load this message in the networking platform