Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Summing up minutes
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Summing up minutes
Miscellaneous
Thread ID:
00493620
Message ID:
00493620
Views:
51
I have a table with fields: phone_number, city, state, duration.
The phone_number field is 10 characters, I only need the first 6 of them (area code and prefix).
i need a query that will go through the table of 20 million records and for each phone number that is the same, add up the minutes for that number. this is what i tried:

select state, city, padr((left(phone_number,6)), 10) as phone_num;
sum (bill_dur) as minutes;
order by minutes desc;
from calls_table;
group phone_num

i can not get it to work.
any ideas?
thanks,
Ryan
Next
Reply
Map
View

Click here to load this message in the networking platform