Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL -- getting hourly averages of 15 minute bars
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01593485
Message ID:
01593539
Vues:
34
>Wow!. No, I meant, for the entire table, which has years 2011 through 2013, and which has multiple accounts, for all of this--- show the maximum
>rating, in any of these years, that each account received, from 2011 through 2013. And, for the same time period,
>show THE which in month, each account logged its maximum rating. I hope this is possible. Thank you!!
>Steve

Can you please formulate again your request? May be show the desired output?

To show maximum rating for each account and know which year (and month) that rating was achieved is slightly more complex problem and can be solved with derived table in VFP, e.g.
select R.* from Ratings R INNER JOIN (select Account, max(mRating) as MaxRatingForAccount from Ratings GROUP BY Account) Mx 
ON R.Account = Mx.Account and R.mRating = Mx.MaxRatingForAccount
The above may return more than 1 row per account if the account has same max ratings in different year/month/hour/15 minutes interval

If you need just one row (doesn't mean which one) and you have ID column in your table, then this can be solved by creating composite max key....
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform