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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:49:19+00:00 2026-06-13T09:49:19+00:00

I have this function i need to do that in sql (hibernate or mysql)

  • 0

I have this function

i need to do that in sql (hibernate or mysql) or a java function that interpert the array of results

i need a consequetive results fort groupe by day

select DAY(prop.docCreationDate), count(prop.docfullName) from propCode.propClass as prop where prop.docCreationDate >= ‘” + startDate + ” 00:00:00’ and prop.docCreationDate <= ‘” + endDate + ” 23:59:59’ GROUP BY DAY(prop.docCreationDate)”

i have this entitie count in my table
2012-10-05   3
2012-10-06   0
2012-10-07   7
2012-10-08   13
2012-10-09   9
2012-10-10   0
2012-10-11   0
2012-10-12   3

the request return me this values
5    3
7    7
8    13
9    9
12   3

in this way i loose three lignes that have 0 as value, i need a request that return me this
5    3
6    0
7    7
8    13
9    9
10   0
11   0
12   3  
  • 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-13T09:49:20+00:00Added an answer on June 13, 2026 at 9:49 am

    I’m assuming that in your propClass table you have multiple entries per day with document path names. Since the entries that you have provided are already almost what you need, except for a day conversion, and it’s not matching the query used.

    Considering this, the entries mentioned by you are the total number of documents per day and I assume that for the missing days you inserted the 0 values. If so, you can use time_intervals temporary table like the one mentioned here. And then you should be able to do something like:

    call interval_between('"+ startDate +"', '" + endDate + "', 'DAY', 1);
    
    select day(ti.interval_from), count(prop.docfullName) from time_intervals ti left join propClass as prop 
    on prop.docCreationDate>=ti.interval_from AND prop.docCreationDate < ti.interval_from + INTERVAL 1 DAY
    where ti.interval_from>='"+ startDate +"' and ti.interval_from < '" + endDate + "'
    group by ti.interval_from;
    

    Using native queries you can call the above two statements from hibernate.

    Tested with SqlFiddle.

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

Sidebar

Related Questions

I have this jquery function that works, except I need to add something. I
I have created this function GetSubName that I need to return the name that
I have something like this: function showFunction () { // need position and place
I have this function in my js file. I need to give time for
I have this function: popstate = function(url){ $('#ajaxloadcontent').load(url+#ajaxloadcontent > *); } I need it
I have this situation: $(#button).toggle(function(){ $(#window).animate({top:'0%'},1000); },function(){ $(#window).animate({top:'-100%'},1000); }); but I need change it
I have the following jQuery which I need adapting: $(document).ready(function(){ $(.rss-popup a).hover(function() { $(this).next(em).stop(true,
I have this function: int firstHeapArray (IntHeapArray h) { if(!emptyHeapArray(h)) return h.array[0]; } It's
We are using grails-groovy with Hibernate, I have a SQL query like this in
I have this big function that gets a lot of different data and insert

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.