Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Result without group by
Message
De
13/07/2005 02:23:05
Walter Meester
HoogkarspelPays-Bas
 
 
À
13/07/2005 00:56:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01032051
Message ID:
01032068
Vues:
17
Hi robert,

Is there any reason you don't want to use sum() and group by ?? This is exactly how I would solve it.
SELECT month, SUM(pen) as pen, SUM(pencil) as pencil, SUM(book) as Book ;
    FROM MyTable ;
    GROUP BY Month
There are of course other ways to do it, but I'd like to hear your motivation to reject the solution above ?

Walter,


>Dear Experts
>
>I have table1, containing data as follows
>
>month pen pencil book
>jan 15 20 35
>feb 27
>feb 37 16
>mar 5 7 98
>apr 47
>apr 46
>apr 45
>
>
>In table1, month feb and apr comes more than one times. If a month comes more than one times then data of other records of the same month should come in first occourance in related fields. I do not want to use command like select sum(pen). The result should look this
>
>month pen pencil book
>jan 15 20 35
>feb 37 27 16
>mar 5 7 98
>apr 45 46 47
>
>Please help
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform