Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create newtable
Message
From
16/08/2011 08:18:01
 
 
To
16/08/2011 08:10:46
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01521078
Message ID:
01521080
Views:
39
>hi all,
>
>i need help to create new table have records as..
>
>*mytable
>empno      file       no           val1        val2      
>1              2         6             500         80
>1              2        28            100         50
>1              3        10            200         70
>2              2          8            100        40
>2              4        18            150        60
>
>
>
>*result new cursor or table
>
>empno     count1   file          no       val1        val2      sum1(val1+val2)    
>1               3          7           44       800         200           1000                
>2               2          6           26       250        100            350
>
>
>thanks

Looks like what you want is:
SELECT empno, CNT(*), SUM(File), SUM(Val1), SUM(Val2), SUM(Val1 + Val2) ;
   FROM MyTable ;
   GROUP BY EmpNO ;
   INTO CURSOR MyResult
Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform