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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:12:46+00:00 2026-05-17T01:12:46+00:00

Some long-gone developer left the following LINQ query behind with no documentation and I’m

  • 0

Some long-gone developer left the following LINQ query behind with no documentation and I’m struggling to understand what it does (and therefore if it’s doing it right). Can someone help translate this, either by breaking it into pieces or providing the SQL equivalent?

Dim matches = From mc In mcs _
              Join ri In r.Items On ri.VIN Equals mc.VIN _
              Group Join t In (From t In claimTarget
                               Order By t.VIN Ascending, t.OrderDate Descending) On _
                        t.VIN Equals mc.VIN Into TargetMatches = Group, _
              InTMS = Count(Not t.PDSCargoItemID = 0), _
              InOTA = Count(Not t.TransportItemInID.IsValueNull) _
              Select Whatever = mc, Match = TargetMatches.FirstOrDefault, Result = ri, InTMS, InOTA

I am struggling in particular with the Group Join and Into TargetMatches = Group pieces:

Group Join t In (From t In claimTarget Order By t.VIN Ascending, t.OrderDate Descending) On _
t.VIN Equals mc.VIN Into TargetMatches = Group
  • 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-17T01:12:47+00:00Added an answer on May 17, 2026 at 1:12 am

    The piece you are struggling with appears to be doing a left outer join against claimTargets on the VIN.

    So for each row in mcs that has a matching VIN in r.Items it finds the most recent (by OrderDate) item from claimTarget that has the same VIN, if any

    The query returns an anonymous object with 5 fields:

    • Whatever = the row from mcs
    • Match = the item from claimTarget that has the matching VIN and the most recent OrderDate (or null)
    • Result = the item from r.Items that has the same VIN
    • InTMS = a count of the number of rows from claimTarget that have the matching VIN where PDSCargoItemID is not 0
    • InOTA = a count of the number of rows from claimTarget that have the matching VIN where TransportItemInID is not null
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that does some long calculations, and I would like to
It is gone now, but for a long time the advanced problems page at
Our Swing application performs some long-running tasks in a background thread using the excellent
I have some long-running Java code running in a thread started by a Java
I am evaluating some web application frameworks out there, and finally, two of the
Alright, some of you might have noticed I've been working on this problem off
I am developing my first Seam + Android application and I am facing some
This is more of a challenge question than something I urgently need, so don't
I've implemented a Service in my android app that starts a timer (using the
A client has a pdf newsletter that weighs in at 1.63 MB, so not

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.