I am using MySql to store telephone taxes statistics.
I have 1 table by month with 60'000 rows each.

My problem is that I need some stats for 3 month.
For example I need to know the total Time(in second) and total Cost
for each Number on a 3 month basis.

Is it possible to do it without creating new tables, and with only one query?

The expectec result would be:

    Number    Total Time     Total Cost
    501       169            0.80
    502        61            0.30

CREATE TABLE may (Number VARCHAR(10), Time INTEGER, Cost DECIMAL(5,2));
CREATE TABLE june (Number VARCHAR(10), Time INTEGER, Cost DECIMAL(5,2));

insert may values ("501", 31, 0.10);
insert may values ("502", 51, 0.20);
insert may values ("501", 93, 0.40);
insert may values ("501", 25, 0.10);

insert june values ("501", 10, 0.10);
insert june values ("502", 10, 0.10);
insert june values ("501", 10, 0.10);

Regards

Denis

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to