Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create newtable
Message
 
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:
01521079
Views:
77
This message has been marked as the solution to the initial question of the thread.
>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
SELECT EmpNo,;
       COUNT(*)  AS Count1,;
       SUM(File) AS File1,;
       SUM(No)   AS No,;
       SUM(val1) AS val1,;
       SUM(val2) AS val2,;
       SUM(val1+Val2) AS Sum1;
FROM YourTable;
GROUP BY EmpNo;
INTO CURSOR crsTest 
BROW NORMAL
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform