简体   繁体   English

无法绑定多部分标识符“ DB1..Students.studentnumber”

[英]The multi-part identifier “DB1..Students.studentnumber” could not be bound

SELECT
       (SELECT Grade
       FROM  DB2..Students
       WHERE   DB2..Students.studentnumber=DB1..Students.studentnumber             
          AND  ISNULL(Students.Disable,'')  != 'T'
    )  as test,* from DB2..Students

WHERE  studentnumber IN
       ( SELECT studentnumber FROM DB2..Students where              
           AND ISNULL(studentnumber,'') !=''
       AND ISNULL(Students.Disable,'')     != 'T'
)

What's wrong? 怎么了?

I am getting an error: "The multi-part identifier "DB1..Students.studentnumber" could not be bound." 我收到一个错误:“无法绑定多部分标识符“ DB1..Students.studentnumber”。”

Please help 请帮忙
Thanks 谢谢

You appear to be using two tables named "Students". 您似乎正在使用两个名为“学生”的表。 One in DB1 and one in DB2. DB1中的一个,DB2中的一个。 You are referencing DB1..Students in your WHERE clause, but not in your FROM clause. 您在WHERE子句中引用DB1..Students,但在FROM子句中未引用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM