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 8805573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:54:05+00:00 2026-06-14T01:54:05+00:00

There is a table Post in my database which contains posts of different users.

  • 0

There is a table Post in my database which contains posts of different users. What I wanna do is to create an sql query that’ll return as per respective month the number of posts being made each day. Kindly let me know how can i do that generically in one query i can create multiple queries for all days but that is a worst case scenario. So I need expert’s solution to this.
Thanks

Expected output:
(Query counts the number of posts for all the days in a respective month)

Day   :   Number of posts

1       :        20

2       :        25

3       :        10

4       :        17

…………………….

30       :        6

Table Structure:
ID | postid | post | date

  • 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-14T01:54:07+00:00Added an answer on June 14, 2026 at 1:54 am
    SELECT DAYOFMONTH(date), count(*) FROM Post
    GROUP BY DAYOFMONTH(date)
    ORDER BY DAYOFMONTH(date) ASC;
    

    If you want to query for a specific month (say, February) then use this:

    SELECT DAYOFMONTH(date), count(*) FROM Post
    WHERE MONTH(date) = '2'
    GROUP BY DAYOFMONTH(date)
    ORDER BY DAYOFMONTH(date) ASC;
    

    Note: Months are returned in number form where the MONTH() function is used.

    EDIT: If you’re looking to return counts for EVERY day in a given month, then I’d push you here – a great accepted answer to a similar question: How to get values for every day in a month

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Image that I have a huge database which stores threads and posts from different
In a MySQL (5.1) database table there is data that represents: how long a
Here's my database schema: create table Post ( PostId int primary key identity, ImageUrl
If you have a table called posts, which contains id, title, content .etc, how
I have a table 'posts' in database which has non-unique index on user_id (Key:
Is there a table i can query all of Oracle Reserved Words? Example, i
in a Table there is a single attribute(column).it contains numbers.Some are repeated(2 or 3
in an sql table there's an id, first name and last name field. i'd
I have Question and QuestionTypes. In Question table there is a foreign key that
I have a question about generic list. Assume that I have a database which

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.