Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8202647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:15:34+00:00 2026-06-07T07:15:34+00:00

Guys i m having a table in which i have gender and date columns

  • 0

Guys i m having a table in which i have gender and date columns as described.
now i wan to count both male n females registered in particular month,so how can i make my query for that.

mysql> select id,gender,entrydate from patient_master;

+----+--------+------------+
| id | gender | entrydate  |
+----+--------+------------+
|  1 | Male   | 2012-07-02 |
|  2 | Female | 2012-05-10 |
|  3 | Male   | 2012-05-25 |
|  4 | Female | 2012-07-09 |
|  5 | Male   | 2012-07-10 |
|  6 | Female | 2012-07-10 |
|  7 | Male   | 2012-07-10 |
+----+--------+------------+
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:15:36+00:00Added an answer on June 7, 2026 at 7:15 am

    To get the results for all months:

    SELECT YEAR(entrydate) AS yr, MONTH(entrydate) AS mnth, gender, COUNT(*) AS cnt
    FROM patient_master
    GROUP BY YEAR(entrydate), MONTH(entrydate), gender
    

    If you want it for all months of a single year:

    SELECT MONTH(entrydate) AS mnth, gender, COUNT(*) AS cnt
    FROM patient_master
    WHERE YEAR(entrydate) = 2012
    GROUP BY MONTH(entrydate), gender
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I currently have a root table view which has a toolbar at
I have table called Table1 with columns, col1 and col2 with col1 having weblinks
hey guys having this really simple problem but cant seem to figure out have
Hey guys am having a bit of problems with my jQuery, I have all
right guys im having trouble with one. what i want to do is have
Hi guys I am having issue I have this query: SELECT * FROM useraccount
Hey guys I'm having such a hard time of it today. I have a
Hey guys, I have a problem with the following table: CREATE TABLE [dbo].[CA]( [Id]
So im having a problem (obviously). I have the following MySQL table data 7
I wonder if you guys could help me. I have a table called modules

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.