SQL 无法绑定多部分标识符
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14082520/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The multi-part identifier could not be bound
提问by Hunain Hafeez
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.
无法绑定多部分标识符“tblJobBudget.lastmodifiedby”。
采纳答案by dani herrera
This is because there aren't any table or table alias with tblJobBudget
identifier.
这是因为没有任何带有tblJobBudget
标识符的表或表别名。
Your tables are:
你的表是:
tblJobAdv
tblApplication
tblPersonalInfo
tblJobAdv
tblApplication
tblPersonalInfo
But not:
但不是:
tblJobBudget
tblJobBudget
If you need columns from table tblJobBudget
you should include tblJobBudget
in tables with a join
clause:
如果您需要表中的列,tblJobBudget
则应包含tblJobBudget
在带有join
子句的表中:
from tblJobAdv
inner join tblApplication
ON tblJobAdv.advid = tblApplication.advid
inner join tblJobBudget <--here
ON ...
inner join tblPersonalInfo
ON ...