语句:
select dept_Name from dept where dept.dept_Id= emp.dept_Id and dept.dept_Id=1;
错误:
Msg 4104, Level 16, State 1, Line 3
The multi-part identifier “emp.dept_Id” could not be bound.
原因:
用到了emp表,但是该表未在From后引用
修改:
select dept_Name from dept,emp where dept.dept_Id= emp.dept_Id and dept.dept_Id=1;
链接查询规范:
select col1,col2 from table1,table2 where table1.col=table2.col