[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Problem with Query....

Posted on 2008-10-15
4
Medium Priority
?
228 Views
Last Modified: 2011-09-20
Hi there,

Simple query that I cant get to run, this is the query:

SELECT m.*, mt.restricts, b.Module
FROM mat_trnkld m, matprt_trnkld mt LEFT JOIN BOM b
ON m.PartNo = b.partnumber
WHERE m.PartNo = mt.PartNo
AND m.SubProd = '50'

and I'm getting this error:

Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "m.PartNo" could not be bound.


Thanks,

Stelly
0
Comment
Question by:stellyuk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 5

Accepted Solution

by:
jfmador earned 1000 total points
ID: 22727769
Define your join between mat_trnkld and matprt_trnkld before using the left join

Try this
SELECT m.*, mt.restricts, b.Module
FROM mat_trnkld m INNER JOIN matprt_trnkld mt on m.PartNo = mt.PartNo
LEFT JOIN BOM b ON m.PartNo = b.partnumber
WHERE m.SubProd = '50'
0
 
LVL 2

Assisted Solution

by:Deepika_Rastogi
Deepika_Rastogi earned 1000 total points
ID: 22728139
Hi

As matprt_trnkld and BOM are joined with each other we can't use mat_trnkld in the bound.
Instead in the bound condition mention the tables that are joined.
so try this

SELECT m.*, mt.restricts, b.Module
FROM mat_trnkld m, matprt_trnkld mt LEFT JOIN BOM b
ON mt.PartNo = b.partnumber
WHERE m.PartNo = mt.PartNo
AND m.SubProd = '50'

Hope you find the solution.
Deepika

0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question