Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Result without group by
Message
From
13/07/2005 02:23:05
Walter Meester
HoogkarspelNetherlands
 
 
To
13/07/2005 00:56:57
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01032051
Message ID:
01032068
Views:
18
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
Previous
Reply
Map
View

Click here to load this message in the networking platform