MySQL Forums
Forum List  »  General

count() question
Posted by: Michael Vasquez
Date: March 24, 2005 08:01PM

I have a table listing customers and another table listing all invoices. Some invoices are paid and some are pending. I am trying to figure out a query that will count the total amount of pending invoices by joining both of these tables, if possible. Here is what I have so far.

SELECT organization, count(paid)
FROM clients
left join Invoices on clients.clientID=Invoices.clientID
group by clients.organization

Basically what I want to accomplish is output all the clients information and output the count of unpaid invoices. What I need to do, I think, is to incorporation a select statement within the "count(paid)" of the select statement.

Any suggestions?

Mike V

Options: ReplyQuote


Subject
Written By
Posted
count() question
March 24, 2005 08:01PM
March 28, 2005 08:42PM
March 30, 2005 03:54AM


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.