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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:28:08+00:00 2026-05-28T13:28:08+00:00

I will give 2 examples, 1st one that works, and the 2nd with what

  • 0

I will give 2 examples, 1st one that works, and the 2nd with what I want to do:

SELECT P.ProjName, D.update_date, SUM(E.pass), SUM(E.fail)
  FROM execution AS E INNER JOIN ( 
    daily AS D INNER JOIN project AS P ON D.project_ID = P.ID )
    ON E.daily_ID = D.ID
  WHERE D.project_id = 25 AND D.update_date = ( 
    SELECT MAX(update_date) FROM daily WHERE project_id = 25; )
  GROUP BY P.ProjName, D.update_date;

This will work for individual projects. It gives me the total of Pass and Fails for the latest day of a given project (here, 25). I would like to grab a group of projects using an WHERE IN clause. For example (but does not work):

SELECT P.ProjName, D.update_date, SUM(E.pass), SUM(E.fail)
  FROM execution AS E INNER JOIN ( 
    daily AS D INNER JOIN project AS P ON D.project_ID = P.ID )
    ON E.daily_ID = D.ID 
  WHERE D.project_id IN (25,26,28,29,30,31)
  GROUP BY P.ProjName, D.update_date
  HAVING MAX(D.update_date);

This will result in every date getting pulled for each of the projects. There are 3 tables involved, ‘project’ which is linked by ‘daily’, which is linked by ‘execution’. So, for every project, there is multiple daily data, and each day has multiple execution data. I realize the HAVING MAX probably needs a comparison, but to what? Perhaps a modified JOIN will help.

Thanks,
Keith

  • 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-28T13:28:09+00:00Added an answer on May 28, 2026 at 1:28 pm

    It’s a bit tricky trying to do this without knowing the database but try this:

    SELECT P.ProjName, D.update_date, SUM(E.pass), SUM(E.fail)
      FROM execution AS E INNER JOIN ( 
        daily AS D INNER JOIN project AS P ON D.project_ID = P.ID )
        ON E.daily_ID = D.ID
      WHERE D.project_id IN (25,26,28,29,30,31) AND D.update_date = ( 
        SELECT MAX(update_date) FROM daily WHERE project_id = D.project_id)
      GROUP BY P.ProjName, D.update_date;
    

    I really have no idea if this is close to anything you’d want.

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

Sidebar

Related Questions

I am making a site that will give some code examples . So, I
I need a regex that will give me the following results from each example
I'm not sure that I'm using the correct language here so I will give
I will give a few examples of the form issue I am running into.
I am writing an extension to NSURL that will give it a convenience method
i will give an example of the problem i have. My XML is like
Which ORM will give me compile-tested queries? Is linqtosql compile time tested? Edit: Say
Which code snippet will give better performance? The below code segments were written in
AssemblyName.GetAssemblyName().Version.ToString() will give the version number ,,but i need to get version number from
I know the code is missing (Someone will give negative numbers). But I only

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.