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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:50:55+00:00 2026-05-20T00:50:55+00:00

Job ——– Id Description JobStatus ———- Id JobId StatusTypeId Date How do I get

  • 0
Job
--------
Id
Description


JobStatus
----------
Id
JobId
StatusTypeId
Date

How do I get the current JobStatus for all jobs?

so something like….

SELECT * FROM Job j
INNER JOIN ( /* Select rows with MAX(Date) grouped by JobId */ ) s
    ON j.Id = s.JobId

(I’m sure there are a bunch of similar questions already but I couldn’t find anything which exactly does what I need).

  • 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-20T00:50:56+00:00Added an answer on May 20, 2026 at 12:50 am

    In SQL Server 2005+:

    SELECT  *
    FROM    job j
    OUTER APPLY
            (
            SELECT  TOP 1 *
            FROM    jobstatus js
            WHERE   js.jobid = j.jobid
            ORDER BY
                    js.date DESC
            ) js
    

    In SQL Server 2000:

    SELECT  *
    FROM    job j
    LEFT JOIN
            jobstatus js
    ON      js.id =
            (
            SELECT  TOP 1 id
            FROM    jobstatus jsi
            WHERE   jsi.jobid = j.jobid
            ORDER BY
                    jsi.date DESC
            )
    

    These queries handle possible duplicates on Date correctly.

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

Sidebar

Related Questions

I know that Job.all returns an array of all jobs. But, what would be
For a background job which I would like to run in a J2EE container,
Background Job gets mentioned a lot but all the tutorials I've seen seem to
While a Hadoop Job is running or in progress if I write something to
At my current job I've been the only web developer for almost 3 years.
I have a job table that holds jobs and leaddate is the field for
My Job model has job_date field that is defined in the migration file like
In my current job the supervisor's practice is to only check in production ready
Your job is to design a Project Plan class library which supports the tracking
A job came in to me that's built with CodeCharge - had a look

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.