自联合有错误! sqlserver2005

发布时间:2024-05-29 15:55 发布:上海旅游网

问题描述:

select test.age from test as test2

消息 4104,级别 16,状态 1,第 1 行
无法绑定由多个部分组成的标识符 "test.age"。

但是这样就没有错误???????

select age from test as test2

想不通???????????????

问题解答:

这样写:
select test2.age from test as test2

select test.age from test
给表起了别名以后,就要使用别名,不能使用原表名

热点新闻