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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:51:59+00:00 2026-05-30T15:51:59+00:00

OK, I am having difficulties with this query, What I want to do is

  • 0

OK, I am having difficulties with this query, What I want to do is join titles.pub_id to publishers.pub_id and then join publishers.pub_id onto employee.pub_id.

This is what I have came up with so far

In the titles table
title_id is the primary key
pub_id is a foreign key

In the publishers table
pub_id is the primary key
pub_name is a canidate key

in the employee table pub_id is a foreign key

SELECT titles.title_id
FROM titles
INNER JOIN titleauthor on titleauthor.title_id = titles.title_id
--INNER JOIN employee on employee.pub_id = publishers.pub_id
--INNER JOIN publishers on publishers.pub_id = titles.pub_id

The error that I get from this query is

Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "publishers.pub_id" 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-30T15:52:01+00:00Added an answer on May 30, 2026 at 3:52 pm

    Joins are left-associative, so an ON clause can only refer to tables that are joined earlier in the query, not to tables that are joined later. So you need to change the order of these two lines:

    INNER JOIN employee on employee.pub_id = publishers.pub_id
    INNER JOIN publishers on publishers.pub_id = titles.pub_id
    

    giving this:

    INNER JOIN publishers on publishers.pub_id = titles.pub_id
    INNER JOIN employee on employee.pub_id = publishers.pub_id
    

    in order that on employee.pub_id = publishers.pub_id not refer to publishers before it’s joined.

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

Sidebar

Related Questions

I'm having some difficulties with Ajax.BeginForm I have something like this in a view
I have having difficulties on this one page login.php. Because of the nature of
I'm having real difficulties optimising a MySQL query. I have to use the existing
I am having difficulties with forms, specifically ModelMultipleChoiceField. I've pieced together this code from
I am having difficulties how to construct my question, but if I have to
I'm having some difficulties with a query: SELECT d.*, (SELECT COUNT(id) FROM downloads WHERE
I'm having difficulties working with some legacy enums that have multiple zero values. Whenever
I'm having some difficulties with this problem. The main idea is, I initialized a
I'm having difficulties grasping how to do this. I am making a product options
I am having difficulties with listing this type of data. Scenario is as follows:

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.