一尘不染

多部分标识符无法绑定

sql

试试这个

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

给出错误

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

不能绑定多部分标识符“ tblJobBudget.lastmodifiedby”。


阅读 180

收藏
2021-03-10

共1个答案

一尘不染

这是因为没有任何带有tblJobBudget标识符的表或表别名。

您的表是:

  • tblJobAdv
  • tblApplication
  • tblPersonalInfo

但不是:

  • tblJobBudget

如果需要表中的列,tblJobBudget则应tblJobBudget在表中包含一个join子句:

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