The multi-part identifier could not be bound

独自空忆成欢 提交于 2019-11-28 05:49:10

问题


trying this

select tblPersonalInfo.companyname, tblJobBudget.title,tblJobBudget.lastmodifiedby,
tblJobAdv.advtitle, tblJobAdv.userId,       
tblApplication.advid, tblApplication.position
from tblJobAdv 
inner join tblApplication
ON tblJobAdv.advid = tblApplication.advid
inner join tblPersonalInfo
On tblJobBudget.lastmodifiedby = tblPersonalInfo.userid

gives error

Msg 4104, Level 16, State 1, Line 8
The multi-part identifier "tblJobBudget.lastmodifiedby" could not be bound.
Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "tblJobBudget.title" could not be bound.
Msg 4104, Level 16, State 1, Line 2

The multi-part identifier "tblJobBudget.lastmodifiedby" could not be bound.


回答1:


This is because there aren't any table or table alias with tblJobBudget identifier.

Your tables are:

  • tblJobAdv
  • tblApplication
  • tblPersonalInfo

But not:

  • tblJobBudget

If you need columns from table tblJobBudget you should include tblJobBudget in tables with a join clause:

from       tblJobAdv 
inner join tblApplication
   ON tblJobAdv.advid = tblApplication.advid
inner join tblJobBudget                              <--here
   ON ...
inner join tblPersonalInfo
   ON ...


来源:https://stackoverflow.com/questions/14082520/the-multi-part-identifier-could-not-be-bound

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!