> 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 >
I did try UNION and I am able to obtain one table, but I can not have one grand total for each column. Denis -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]