On Monday 02 August 2004 02:39, Denis Geser 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?
The tool you're looking for is the UNION statement. It looks like select field1, field2 from tableA ; union ; select field1, field2 from tableB ; union ; select field1, field2 from tableC You'll have to mess around a bit to get the totals, etc. -- Whil Moving to Linux: Freedom, Choice, Security, Opportunity http://www.hentzenwerke.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]