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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:29:43+00:00 2026-06-11T01:29:43+00:00

I would like to draw a linear chart in my xhtml page. In the

  • 0

I would like to draw a linear chart in my xhtml page. In the abscissa, I want to put the months, and in the ordinate I want to put the quantity of orders per month.
In your opinion, is it possible to create a mysql query to return a list in which each row contains one month and quantity of orders in the second attribute.

here is my table :

enter image description here

and here is the sql query to retrieve all date_envoi :

select date_envoi from commande;

here is the image :

enter image description here

  • 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-11T01:29:44+00:00Added an answer on June 11, 2026 at 1:29 am

    You need to GROUP records by MONTH and YEAR:

    SELECT DATE_FORMAT(date_envoi, '%M %Y') AS month,
           COUNT(*) AS order_quantity
    FROM commande
    GROUP BY YEAR(date_envoi), MONTH(date_envoi);
    

    EDIT: To get month in numeric format:

    SELECT YEAR(date_envoi) AS year,
           MONTH(date_envoi) AS month,
           COUNT(*) AS order_quantity
    FROM commande
    GROUP BY YEAR(date_envoi), MONTH(date_envoi);
    

    EDIT 2:

    SELECT `month`, SUM(order_quantity) AS order_quantity
    FROM(
    
        SELECT MONTH(date_envoi) AS month,
               COUNT(*) AS order_quantity
        FROM commande
        GROUP BY MONTH(date_envoi)
        UNION ALL
        SELECT 1 AS month, 0 order_quantity
        UNION ALL
        SELECT 2 AS month, 0 order_quantity
        UNION ALL
        SELECT 3 AS month, 0 order_quantity
        UNION ALL
        SELECT 4 AS month, 0 order_quantity
        UNION ALL
        SELECT 5 AS month, 0 order_quantity
        UNION ALL
        SELECT 6 AS month, 0 order_quantity
        UNION ALL
        SELECT 7 AS month, 0 order_quantity
        UNION ALL
        SELECT 8 AS month, 0 order_quantity
        UNION ALL
        SELECT 9 AS month, 0 order_quantity
        UNION ALL
        SELECT 10 AS month, 0 order_quantity
        UNION ALL
        SELECT 11 AS month, 0 order_quantity
        UNION ALL
        SELECT 12 AS month, 0 order_quantity
    ) a
    GROUP BY `month`
    ORDER BY `month` ASC;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to draw a chart in OpenGL similar to the donut graph
I would like to draw a realtime chart on a WindowsForm. My platform is
I would like to draw a circle with an initial degree and I want
I would like to draw a straight line on plot using the following linear
I am new to Quartz, and I would like to draw a candlestick chart
I would like to draw text on a canvas using the Canvas.drawText call for
I would like to draw some shapes on a JPanel by overriding paintComponent .
I would like to draw a line or bar graph using HTML5 canvas. I
I would like to draw a box using SAS/GRAPH with a color gradient (say
in vb.net i would like to draw a regular line on a form. is

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.