Hello People,

I have the following request since long time ago. I use MySQL 4.1 for our Applications. Some times a get to the time that I need to do a select or present a result witht the following format.

Table 1 - List of Customers

Table 2 - List of Bills for Customers

Table 3 - List of Payments done by the Customer

For example I whant to do a select that will put in on row the following information:

Columns 1 = Customer Name
Column 2 = SUM(All bills that are in statis = 'Active')
Column 3 = SUM(All Payments done by the Customer)
Column 4 = AVG(Average of Bill Totals for this Customer)

Is there a way to do this in SQL? And if so would it be thru TempTables ?

Thanks For the Help.