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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:18:27+00:00 2026-05-22T22:18:27+00:00

Possible Duplicate: What is the most straightforward way to pad empty dates in sql

  • 0

Possible Duplicate:
What is the most straightforward way to pad empty dates in sql results (on either mysql or perl end)?

Create Table:

CREATE TABLE `trb3` (
  `value` varchar(50) default NULL,
  `date` date default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 


SELECT date, SUM(value) AS value FROM trb3 GROUP BY date ORDER BY date DESC

but

  Jun 30 2011,100
  Jun 29 2011,90
      .
      .
  Jun 10 2011,90
  Jun 02 2011,89
  Jun 01 2011,10

Why Jun 03 data is not appear?

How to solve this problem.

  • 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-05-22T22:18:27+00:00Added an answer on May 22, 2026 at 10:18 pm

    You’ll need to get a list of the dates you want then outer join with it:

    create table my_dates (my_date date not NULL);
    

    then populate my_dates with the dates you want data for:

    insert into my_dates values ('2011-06-01'), ('2011-06-02'), ...;
    

    then

    select my_dates.date, SUM(value)
    from my_dates left join trb3 on trb3.date = my_dates.my_date
    group by 1;
    

    EDIT:
    FYI, this is not intended to be a temporary table, it’s a permanent table.

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

Sidebar

Related Questions

Possible Duplicate: most elegant way to return a string from List<int> I'm not sure
Possible Duplicate: The most efficient way to implement an integer based power function pow(int,
Possible Duplicate: What is the most efficient way to clone a JavaScript object? I
Possible Duplicate: What is the most efficient way to clone a JavaScript object? How
Possible Duplicate: Using Git with Visual Studio What's the most painless way for the
Possible Duplicate: Most efficient implementation of a large number class Suppose I needed to
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions
Possible Duplicate: Most Useful Attributes in C# I always feel that I am missing
Possible Duplicate: Anyone else find naming classes and methods one of the most difficult
Possible Duplicate: Why use document.write? Considering the negative effects of document.write(), why are most

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.