Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create a new table
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00411710
Message ID:
00411719
Views:
9
>I have a table that has two columns, terminating lata and number of minutes. Each individual record is a phone call. Each terminating lata appears many times in the table so therefore are many calls that terminate in the same lata. What I need to do is create a new table that has three fields, terminating lata (having each different terminating lata appearing only once), Number of calls for each terminating lata (how many times a terminating lata appeared in the original table), and number of minutes for each terminating lata (sum of the minutes for each different terminating lata from original table). I really don't know how to go about this.
>Any ideas would be appreciated.
>Thanks,
Ryan,

Use SQL - SELECT into a table. Use the COUNT(*) function to count the number of calls, the SUM() function to total the minutes, and the GROUP BY clause to group the data. It should look something like this:
SELECT Lata, COUNT(*) AS Occurs, SUM(Num_Mins) AS Total_Time;
  FROM SourceTable;
  GROUP BY Lata;
  INTO TABLE NewTable
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform