Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select Max to Mini last 12 month
Message
De
28/09/2006 10:26:05
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Select Max to Mini last 12 month
Divers
Thread ID:
01157837
Message ID:
01157837
Vues:
65
Hi all,

I have mytable :

mytable.dbf

YearMonth ( character field )

200609
200609
200608
200608
200607
200607
200606
200606
200605
200605
200604
200604
200603
200603
200602
200602
200601
200601
200512
200512
200511
200511
200510
200510
200509
200509
200508
200508
200507
200507
200506
200506

to get only last 12 months :

newtable ( 2 fields )

yearmonth MaxMiniMonth
200609 12
200608 11
200607 10
200606 9
200605 8
200604 7
200603 6
200602 5
200601 4
200512 3
200511 2
200510 1

Select yearmonth from mytable group by yearmonth

How to get MaxMiniMonth in my select SQL ?

TIA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform