MySQL Forums
Forum List  »  Newbie

Count by date
Posted by: Dan Bent
Date: April 12, 2005 01:13PM

I'm a SQL newbie, and I expect that this question has come up before, but I'm stuck. Any help is appreciated.

I have people in a database. They have a beginning date and an ending date.
I need to write a query that counts the number of people active on the first of each month.

If my "people" table has:

Name Start End
Bob 01/01/2005 02/28/2005
Steve 02/01/2005 03/30/2005

The report should show:

Month Count
Jan 05 1
Feb 05 2
Mar 05 1
April 05 0

Options: ReplyQuote


Subject
Written By
Posted
Count by date
April 12, 2005 01:13PM


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.