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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:45:49+00:00 2026-05-28T18:45:49+00:00

I need to perform a JOIN on a JOIN-ed table, and I’m not sure

  • 0

I need to perform a JOIN on a JOIN-ed table, and I’m not sure how to accomplish it. Hopefully, the query below demonstrates what I’m trying to do: get country names, each country’s leader, and each leader’s home town.

I think the problem with this query is using the JOIN-ed table “President” in the second join with President.HomeTown_Id. I don’t know what else to try.

SELECT 
  Countries.Name AS Country, 
  President.Name AS Leader,
  PresidentHomeTown.Name AS LeaderHomeTown
FROM Countries
  LEFT OUTER JOIN PoliticalFigures AS President ON Countries.President_Id = President.Id
  LEFT OUTER JOIN Cities AS PresidentHomeTown ON President.HomeTown_Id = PresidentHomeTown.Id

In VS, I’m getting the error, “The multi-part identifier “President.Id” could not be bound.”

The names of tables and fields are fictitious, but I need to solve an identical problem. I changed the names to make things clearer; hopefully this will be relevant to more people.

— update —

Maybe the original code helps:

SELECT 
    CaseComparisons.Directory AS CaseComparisonDir, 
    BaselineResult.Directory AS BaselineResultDir, 
    ComparisonResult.Directory AS ComparisonResultDir,
    Setup.FullSvnLink AS SvnLink,
    BaselineVersion.FullFilePath AS BaselineExecutableDir
FROM CaseComparisons 
    LEFT OUTER JOIN Results AS BaselineResult ON CaseComparisons.BaselineResult_Id = Baseline.Id 
    LEFT OUTER JOIN Results AS ComparisonResult ON CaseComparisons.ComparisonResult_Id = Comparison.Id
    LEFT OUTER JOIN Setups AS Setup ON Baseline.Setup_Id = Setups.Id
    LEFT OUTER JOIN BuildVersions AS BaselineVersion ON BaselineResult.Version_Id = BuildVersions.Id
WHERE 
    CaseComparisons.Status = 'Queued' OR 
    Baseline.Status = 'Queued' OR 
    Comparison.Status = 'Queued'

The errors I get when I run the query:

The multi-part identifier "Baseline.Id" could not be bound.
The multi-part identifier "Comparison.Id" could not be bound.
The multi-part identifier "Baseline.Setup_Id" could not be bound.
The multi-part identifier "Setups.Id" could not be bound.
The multi-part identifier "BuildVersions.Id" could not be bound.
The multi-part identifier "Baseline.Status" could not be bound.
  • 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-28T18:45:51+00:00Added an answer on May 28, 2026 at 6:45 pm

    You’ve got mismatches between the aliases you’re specifying (e.g. in Results AS ComparisonResult) and the aliases you’re trying to use (e.g. in Comparison.Id). So, change this:

        LEFT OUTER JOIN Results AS ComparisonResult
                     ON CaseComparisons.ComparisonResult_Id = Comparison.Id
    

    to either this:

        LEFT OUTER JOIN Results AS ComparisonResult
                     ON CaseComparisons.ComparisonResult_Id = ComparisonResult.Id
    

    or this:

        LEFT OUTER JOIN Results AS Comparison
                     ON CaseComparisons.ComparisonResult_Id = Comparison.Id
    

    (and similarly for all the other joins).

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

Sidebar

Related Questions

I have a table I need to perform a horrible query on (not my
I need to perform a filtered query from within a django template, to get
I have a query I need to perform on a table that is roughly
I need to perform a HTTP GET from PHP. More specifically, from within /index.php
I need to perform a LINQ query for both a time period from a
I am writing an SQL query in which that I will need to perform
I am trying to perform a SELECT query on two tables joined with a
I am trying to perform a simple join on two tables and am having
I am trying to perform a SELECT query using a GROUP BY clause, however
I need to perform some action when my application receives focus. I've tried hooking

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.