MySQL Forums
Forum List  »  Perl

Selecting Columns from Multiple Tables.
Posted by: Sravan Puttagunta
Date: July 30, 2006 02:33PM

So I have a calendar script which generates a list of dates from 2000 to 2010 with matching week and months.

Here is a sample entry:
Month Date Day Formatted Date Week #
January 01 Saturday 2000-01-01 0
January 02 Sunday 2000-01-02 0
..
..
..
January 08 Saturday 2000-01-08 1

This table goes all the way to 2100.

Now my other table generates this.
DATE PASS FAIL KILLED SUM
2005-04-08 0 4 0 4
2005-04-13 0 1 1 2
2005-04-15 55 3 0 58
2005-04-16 306 5 0 311
2005-04-17 293 0 0 293


Now I want to generate a table which increments the dates and fills in the fields and groups it by month.

*R (This is the sum of all the entries for the month of April)

Month Year Sum(*R)
April 2006 40
..
...

So basically I need to be able to group the 2nd table by month and get the sum and get the corresponding dates from the calendar script to put the sums in by months.

Any help would be nice.

Options: ReplyQuote


Subject
Written By
Posted
Selecting Columns from Multiple Tables.
July 30, 2006 02:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.