Information générale
Catégorie:
Codage, syntaxe et commandes
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement