Denis Geser <[EMAIL PROTECTED]> wrote: > 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?
I think so, see GROUP BY clause syntax and grouping functions: http://dev.mysql.com/doc/mysql/en/SELECT.html http://dev.mysql.com/doc/mysql/en/Group_by_functions_and_modifiers.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]