Hi

In my opinion I would imagine Merged tables would do what you wanting. Refer
to the MYSQL manual.

Thanks


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Warren van der Merwe
Software Director
PRT Trading (Pty) Ltd t/a RedTie
Cell (083) 262-9163
Office (031) 767-0249


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> ]On Behalf
> Of Wix,Christian XCW
> Sent: 23 April 2001 02:02
> To: '[EMAIL PROTECTED]'
> Subject: Query problems
>
>
> Hi
> I have two similar tables. (table1 & table2). They contain the columns
> "name", "distance" and "date". Table1 is year 2000 and Table2
> year 2001.
>
> I need to get the total distance for each name.
> For year 2000 I would do this:
> select name, SUM(distance) from table1 group by name;
>
> How do I do it for both years? (one query)
>
> Thanks,
>
> // Chris - Copenhagen
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to